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.

35 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
882 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 ...
1
vote
1answer
22 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 ...
1
vote
2answers
36 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 ...
1
vote
1answer
17 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 ...
1
vote
1answer
668 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 ...
1
vote
3answers
145 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: ###-###-#### (###) ###-#### ### ### #### ###.###.#### ...
1
vote
2answers
1k 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. ...
0
votes
0answers
20 views

Google sheets: Regexextract next or previous whole word or number from cell in sheets

How do I extract the next word or number (including comma and delimiter) to a search string from a cell in sheets? And how the previous? ={$AV$14; ArrayFormula(IF(ISBLANK($AT$2:$AT),, iferror( value(...
0
votes
1answer
16 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
0
votes
2answers
502 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 ...
0
votes
2answers
54 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, ...
0
votes
1answer
26 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 ...
0
votes
1answer
208 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
0
votes
0answers
119 views

Regular expression in Google Forms Quiz Answer Key

Google Forms has the ability to create quizzes with an answer key containing possible correct answers. For instance, if you wanted to forgive misspellings, then your answer key could include "...
0
votes
0answers
302 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); ...
0
votes
2answers
3k views

In Google Sheets I need to find a string and return true/false, or even a count into a cell so I can perform an action

In my example i have a column with Names of signs we product in our sighshop and I need to be able to isolate similar named signs So say I need to return a a value if the cell is Bud Light and only ...
0
votes
2answers
153 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 ...
0
votes
2answers
80 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 ...
0
votes
1answer
58 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 ...
0
votes
1answer
54 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 ...
0
votes
1answer
25 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 ...
0
votes
3answers
807 views

Checkbox to activate a column in QUERY

Is there a way to activate/deactivate a column in QUERY function? I have a query to query and selection of several columns Select Col1,Col31,Col32,Col33,Col25,Col26, and want to have a checkbox for ...
0
votes
2answers
328 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",...
0
votes
1answer
457 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 ...
0
votes
1answer
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 ...
0
votes
2answers
273 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 ...
0
votes
2answers
34 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")) ...
0
votes
0answers
848 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 ...
0
votes
2answers
68 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 ...
0
votes
2answers
324 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 ...
0
votes
1answer
234 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() { ...
-1
votes
1answer
48 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 ...
-1
votes
2answers
51 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 ...
-1
votes
1answer
191 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 ...
-2
votes
1answer
893 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?