Questions tagged [regex]

regex stands for "regular expressions". They are used to define a string search pattern that could be used in some web applications like Google editors to do input validation, search and replace among other similar tasks.

37 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
889 views

How to write a clean Gmail filter for SVN commits?

I have a dozen or so SVN projects that generate a few dozen email messages every day, each with subject line like this [SVN projectname] in branch/trunk list of files. I want to send these email ...
user avatar
  • 121
1 vote
1 answer
19 views

How to exclude all terms except one word in title when searching YouTube or Google?

That is, how to find one-word-titled webpages in Google search results or in YouTube search results. For example, when searching YouTube for the word ‘verb’, I want only videos with the word ‘verb’ as ...
user avatar
1 vote
1 answer
26 views

How to create an average value for every cell which contains a certain phrase?

I need to find the average value of cells containing a certain set of initials to create a scoreboard. The value of the cell being the score and the brackets containing the initials of the score ...
user avatar
1 vote
2 answers
48 views

Spreadsheet formula to calculate most common items in ordered items lists

I am searching for a correct google spreadsheet formula to go through the list of ordered items and summarise the resulting winning items. Like is you have an Oscar ceremony and you get votes from ...
user avatar
  • 153
1 vote
1 answer
21 views

Issue with finding the averages of multiple rows at once

I am currently tasked with hundreds of rows of data for a project. I need to take the average of each row, but there are way too many rows for me to do by each individual row. Is there any way to take ...
user avatar
1 vote
1 answer
1k views

Arrayformula for running MAX of separate column

I'm trying to use ARRAYFORMULA in Google Sheets to get the max figures from a separate column only up to the row being calculated each time but can't for the life of me figure out how. It sounds more ...
user avatar
  • 111
1 vote
3 answers
183 views

Create a regex for Google Analytics, to tack a specific US phone number that can be in multiple formats

I want to write a regular expression to tack a number in Google Analytics for a specific US phone number that supports the following formats: ###-###-#### (###) ###-#### ### ### #### ###.###.#### ...
user avatar
1 vote
2 answers
2k views

Using Google Sheets to bulk collect the number of Google Search results for given keywords

I would like to create a Google Sheets that will allow me to paste in a list of 25 or so keywords in column A and would then return the number of search results for each of those terms in column B. ...
user avatar
0 votes
1 answer
33 views

ArrayFormula and Categorize Data in Google Sheets using Regular Expressions

I'm following this post to categorize data in Google Sheets using regular expressions. The person who wrote the answer was able to get the formula to automatically write down the category in column D. ...
user avatar
0 votes
1 answer
34 views

Google Sheet Regex URL Replace

Looking for regex or another solution to update all the URLs without HTTPS at the start of the domain; for example, domain.com to > https://domain.com. Please, note I have multiple domains in the ...
user avatar
  • 49
0 votes
0 answers
36 views

Issue using Trim and RegExReplace to grab hashtagged terms from text entries

I am new to the more complicated functions of Excel and Google Sheets. I am trying to extract hashtagged words from my journal entries to get the gist of what those entries are about. I had pretty ...
user avatar
  • 1
0 votes
0 answers
348 views

Can I use advanced regex pattern search in Google search?

I tried to find results that match pattern such as Apple\s*,\s*[a-zA-Z]+ but it only returned unnecessary data like regex or etc.. I needed only results like such as "Apple, Samsung". Maybe ...
user avatar
0 votes
2 answers
137 views

Extracting 2nd occurrence of a number in brackets / Google Sheet/Excel

I currently have cell that has the following output from my Google Sheet: Share Price vs. Fair ValueBelow Fair Value: AAPL ($126.85) is trading above our estimate of fairvalue ($118.02)Significantly ...
user avatar
0 votes
1 answer
22 views

How to extract desired text from a cell

As you can see below I have these data in single cell I want only car nos as my result
user avatar
0 votes
2 answers
4k views

Google Sheets for if contains "*"

I have found the the regexmatch solution for substring: Google Sheets formula for "if contains" However, why for "*" is not working? I'm trying to make a condition if the name ...
user avatar
0 votes
2 answers
82 views

In Google Sheets, analyze cell content, and if certain values are present, return a response in the next column

In the below example, I want to analyze each cell in column A, and if the cell's contents match certain parameters, return a value in column B accordingly. So if the value in a col A cell = apple, ...
user avatar
0 votes
1 answer
58 views

How to assign country based off list of either provinces or states?

I have a list of names and locations. Most of the locations include the name of the province or state. Some only include country names, some include state abbreviations. I also have a list of ...
user avatar
0 votes
0 answers
476 views

Extract data from web with Google script

I'm trying to use the function below (source) to avoid using importxml in Google Sheets: function importRegex(url, regex_string) { var html, content = ''; var response = UrlFetchApp.fetch(url); ...
user avatar
0 votes
2 answers
222 views

How to filter after parsing CSV values contained in Google Sheets cells

I would like to be able to match all cells in column A (titles) that have one of the comma-separated values in column E (Key Search Terms). This will involve at least two steps. 1) Parse each of the ...
user avatar
0 votes
2 answers
104 views

IF and IFS not working properly

I am trying to locate data present in different sheets. I have tried using IF and IFS. Below are the formulas I have used. For IF, I get NOT IN USE even when I know there should be one of the sheets ...
user avatar
  • 11
0 votes
1 answer
66 views

If cell y contains any word from range x:x, mark cell y green

In Google Sheets, I have three columns (with different lengths!) Column1 contains firm names (50) Column2 containts firm names (100) I would like to mark a cell in Column1 green (or with a number in ...
user avatar
0 votes
1 answer
101 views

Conditional formatting with multiple names in list

Col A2:C15 contain a list of names. I need to enter those names in various combinations into one of 15 other cells on formatted like: H3 = John, Steve, Bob, Dan Is there a way to use conditional ...
user avatar
0 votes
1 answer
31 views

Sort sentences based on formatting

I have a list of sentences in Google Sheets, each word in a different column. There is a stupid man. How we came here we don't know anything about. Finally, it has come to this. Shaking my head. How ...
user avatar
  • 1
0 votes
2 answers
386 views

IF Function with too many arguments

I want to apply this formula =IF(A2= "", "", IF(REGEXMATCH(A2, "Brand"), "Brand", if(regexmatch(A2, "Loans"), "Loans" , if(regexmatch(A2, "Cards"), "Credit Cards", if(A2, "Generic"),"Generic",...
user avatar
  • 1
0 votes
1 answer
745 views

How to ignore certain strings when creating unique list of words in Google Sheets?

In Google Sheets, I am using the formula to create a unique list of words: =unique(transpose(split(ArrayFormula(concatenate(B2:E"+")),"+"))) But I want to filter out certain strings. My unique list ...
user avatar
  • 111
0 votes
1 answer
1k views

How to TEXTJOIN in Google Sheets

I have ten columns in my rows which contain 5 sets of first name/last name. I want to combine each of these names in a final column using TEXTJOIN (or whatever function is appropriate if I'm missing ...
user avatar
  • 1
0 votes
2 answers
532 views

How to export CSV without commas in unpopulated cells?

I have a form converter which simply rearranges columns. I use a script to paste Values only into another sheet for export and uploading onto another website. However, when I go to export, it seems ...
user avatar
0 votes
2 answers
51 views

How to work over rows from all other sheets in Google Sheets?

I have a 'summary' sheet and 12 other sheets named 'Jan20', 'Feb20', etc. In the summary sheet I have this formula (to calculate Uber costs): =FILTER('Jan20'!F2:F, REGEXMATCH('Jan20'!D2:D, "UBER")) ...
user avatar
0 votes
0 answers
948 views

Match an automatic newline with regex find and replace in Google Docs

Google Docs implements regex find/replace, but I've been unable to match newlines that haven't been created explicitly by pressing the enter key. Is there any way to match 'implicit' newlines in ...
user avatar
0 votes
2 answers
101 views

Cell reference for contains value in Google Sheet

Looking for help referencing another spreadsheet, where I want to lookup several values in cell A2, to see if the value is contained in the cell (as there are variations), then setup an else clause at ...
user avatar
0 votes
2 answers
1k views

How do I replace a paragraph break (i.e. Enter) with a Shift+Enter character in Google Docs?

That is, what regexes do I place in these two boxes I have read Syntax for Unicode characters in regexes in Google Sheets? to no avail. I found from one answer that [\n] matches paragraph mark. Now ...
user avatar
  • 103
0 votes
1 answer
276 views

Replacing data in Google Sheets

I am new to coding! I have data in Sheet 1 of a Larger Spreadsheet that looks like this 25.06.18 and wish to change it to look like 26/06/18 I have tried to write a macro: function Dated() { ...
user avatar
  • 1
-1 votes
1 answer
194 views

Regular expression for csv of numbers less than 1,000

I am going to use JavaScript to validate a string that needs to be: Only digits and commas Can't end or start with a comma Each number between the commas has to less than 1,000 No negatives No ...
user avatar
  • 1
-1 votes
1 answer
532 views

How do I use non capturing groups in google sheets?

This is what I intend to do. But a similar one doesn't work. As with any problem I post, I still can't solve it after more than two hours of trying. :-( https://github.com/google/re2/wiki/Syntax
user avatar
  • 111
-1 votes
2 answers
73 views

Help with a Vlookup function to return multiple results of not exact match

I am trying to run the following code to return all the matches of column A from column C in a set of rows. In this situation, cell A1, is contained in a few iterations of column C, however, these are ...
user avatar
-1 votes
1 answer
267 views

How to nullify empty output errors in Google Sheets?

I am using the following code in many cells of the sheet, =SPLIT(REGEXREPLACE("" & S2, "(\d)", "$1,"), ",") not all are going to contain data at any one time. How do I stop the empty cell value ...
user avatar
  • 49
-2 votes
1 answer
1k views

Use regexmatch to determine if one cell's content contains another's

I want use a cell in regexmatch as regular_expression parameter. My goal is to draw green background for A1 if B1 contains A1 inside of it. How to do this with regexmatch?
user avatar
  • 105