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.

Filter by
Sorted by
Tagged with
1
vote
1answer
31 views

How to search value in another column?

Using Google Sheets, I am trying to two compare two columns on Google Sheets, like the one below: Basically, I want to compare column A and B, basically, if a cell in column A is inside a cell in ...
1
vote
1answer
20 views

How can I return a string instead of a number when the number is 0

I have a formula that returns average lbs, waist and body fat % for the weeks I've been dieting. The problem is I didn't measure body fat % until a while after I started so some averages are 0. I'd ...
1
vote
1answer
73 views

Convert cell containing days of the week in first-letter format to day names in Google Sheets

I created a schedule of events in Google Sheets. I have a cell that contains MWF, indicating that the event is every Monday, Wednesday, and Friday. I have a different cell that reports the word ...
9
votes
5answers
37k views

Count the number of words in a string in Google Sheets

I have a simple Google spreadsheet with a number of text strings. I just want the number of words contained in each cell. Is there an in-built Google spreadsheet function I may use?
2
votes
2answers
7k views

COUNTIFS with multiple OR

I have two sheets, one is a dump sheet of values like below: and the second sheet is using values from this to the total. I am trying to get the total count for the corresponding zone and test name ...
1
vote
1answer
26 views

Conversion from LibreOffice to Google Sheets

I use LibreOffice to create xlsx files. There are some formulas to test conditions. Everything is ok under LibreOffice but when I open the file with Google Sheets formulas give the wrong result. e.g....
0
votes
1answer
87 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() { ...
2
votes
2answers
1k views

Appending text to each column in Google Sheets

I have a Google Sheets that has about 200 columns. Each one is a name, and to each one, I want to append -banner.jpg. For example: abcde fghij klmno will all be updated to: abcde-banner.jpg fghij-...
1
vote
1answer
17 views

Split cells not importing first 0

I am using split formula: =IFERROR(SPLIT(REGEXREPLACE(" , "&U4, "(\d)", "$1 ,"), ", ")) It works great except if I have 0250, it imports it across as 250, even with the cell it's importing ...
1
vote
1answer
25 views

Comparing two cells and adding text to matching values

I have two columns, one with all items in a set and another with the items I currently have. I would like to compare those and for the matching results to have a bit of text added if they match. So ...
1
vote
2answers
17 views

How to get a true when a character is NOT in range

I want to filter all cells in a range which are not empty and does not contain a certain character. So I tried everything with regexmatch =filter(Planning!G$5:G$37; regexmatch(Planning!G$5:G$37 ; "![...
1
vote
1answer
1k views

Google Sheet Query smarter way to get multiple criteria

I use a spreadsheet where I want a list of items which contains multiple criteria. (I need all cells in a range which contains the letter 'a - g' The formula I use now is =query(Planning!G5:G37; "...
0
votes
2answers
53 views

Google Sheets Conditional Formatting

I am trying to make a certain cell on my sheet light up based on what week it is. Each cell contains the value Week X where the X is a week-number. After a little bit of experimentation I have made ...
1
vote
1answer
22 views

How can I have Google Sheets automatically parse and calculate text that follows a certain pattern?

I have the following sheet: https://docs.google.com/spreadsheets/d/1iEMjWVEwyuqbn_imW1UZ-AF2NlE__IbRZdHQifKJjko/edit?usp=sharing I would like to calculate "Total Work" by deriving it from my own ...
0
votes
2answers
481 views

Data Validation in Google Sheets Using Multiple Criteria

I have a column with text in the format: [text:more text/numbers] I want to ensure whatever is entered into the cell conforms to this syntax, or at least as much of it as possible. text is always 5 ...
2
votes
1answer
144 views

Searching for a sentence that I only know part of it using Google's operators

I am looking for a particular combination of google hacking commands to find a sentence. For example, I am looking for ”where eagles dare” In this case, I don’t have part of a sentence like the ...
0
votes
1answer
69 views

Remove all text before (and excluding) match

Hi I have a cell with data such as: Dropped pin Near Hughanden Village Hall, Pome Ln, Hughanden, Low Slokey, HT11 3AT https://goo.gl/maps/dVtKw423RBA9fkGs7 I would like to use REGEXREPLACE (or one ...
0
votes
0answers
62 views

Google Sheets' REGEX to group values

I need to take into account text across multiple cells using REGEXes to identify larger grouping in another cell. For example, using both a Source and Medium value to determine one larger Channel ...
0
votes
1answer
43 views

Is there a way to search the web by using regex? [closed]

I want to study and find English sentence examples. For example, I read some I'd be working... I want to know the usage of I'd be doing... So I want to search I'd be *ing I'd like to see the ...
11
votes
3answers
7k views

How to use text from capturing groups in Google Docs regex replace?

I'm trying to match certain text and then replace with the text plus some extra characters. Minimal example text: #10 Oranges. These are citrus fruits Desired output: #10 Oranges. These are citrus ...
4
votes
4answers
126 views

Joining two rows of data with alternating delimiters

I'm working with two rows of values that are related to each other and trying to build a formula that will compile the data into one cell, with syntax that uses two delimiters. If a cell in the ...
2
votes
1answer
50 views

Sum value in cells that contain both number and text

I need to sum a range of cells with text in them. Example: a1= "25,00 market" b1="24,00 credit card" c1="75,11 food" a2= "10,00 sweets" b2="9,00 market" c2="24,00 keyboard" I want to sum ...
0
votes
1answer
375 views

Google Docs copy paste formatting / indent question

So say I am taking a YouTube transcript, and copying the whole thing, and then pasting it into a document. The way the transcript is set up with YouTube it's layered like every 5 seconds so its lines ...
-1
votes
1answer
19 views

REGEXMATCH doesn't match, but should work

Why the following REGEXMATCH results FALSE? =REGEXMATCH("aaa E: 111 111 bbb"; " E: ([\d\s]+) bbb") How should I fix it?
0
votes
0answers
633 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 ...
1
vote
2answers
1k views

How to perform multiple operations where the IF statement is true?

The function below is what I use to handle contact information (email/phone numbers). If the entry is an email id (has text), it will keep it as is. When a phone number is entered, it does a variety ...
64
votes
9answers
100k views

Is there a way to search in Google using regular expressions (regex)?

It would be very useful if Google provided a regular expression search. Is there a way to do this? (OBS: I am not talking about false regular expressions like site:, filetype:, AND, OR or "Text". I ...
0
votes
1answer
549 views

Regex compare two strings

I have two strings "*j?a?c?k*c?o?o?p?e?r*a?v?o?n*l?a?k?e*o?h*" and "*j?a?c?k*c?o?o?p?e?r*t?r?a?n?s?p?o?r?t*a?v?o?n*l?a?k?e*t?e?r?m?i?n?a?l*" These seem like they should be equal in regex. However, ...
1
vote
3answers
497 views

How can I use the capturing group in a function?

=REGEXREPLACE("string", "(ng)", UPPER("$1")) The above returns "string", but should return "striNG". I suspect that this is because UPPER is capitalizing the string "$1" rather than the string with ...
14
votes
6answers
3k views

Online regex preview tool [closed]

Is there any good regex webapps out there? I'd like to be able to set which type of regex syntax is used, enter some text and a regex and get matches highlighted. Preferably with different colors so ...
0
votes
1answer
54 views

DPL3 RegEx: How to suppress display of matched parameters?

I'm trying to match {{Tag|Anteater}} Regarding https://help.gamepedia.com/DPL:Parameters:_Criteria_for_Page_Selection#includematch, and https://help.gamepedia.com/DPL:Parameters:...
1
vote
3answers
304 views

Google Sheets - REGEX Challenge

I have a long Google Sheet column of cells with content looking like this: #text: Jacob Zuma @domain: https://www.theguardian.com/world/zuma #text: World news @domain: https://www.theguardian.com/...
0
votes
1answer
5k views

How to manipulate text strings in Google Apps Scripts

I've found this super userful code that I have managed to add to a Google Sheet (total newbie here) but I have a couple of problems. The first is to disregard blanks. I want to select a list, get ...
8
votes
3answers
987 views

Is it possible to search MediaWiki sites using regular expressions?

I'd like to search for phrases using regular expressions on sites such as Wikipedia and Wikimedia Commons. Is it possible to do this? Example regex search query: (facebook|google) (corporate history|...
0
votes
1answer
300 views

Google Analytics Exclude URI filtering

I have a tracking code which is currently used on two ORACLE APEX webapplications. (210 and 400). I have made a view in Google Analytics, which contains a filter that should exclude the 400 ...
1
vote
1answer
2k views

Google Sheets: REGEXEXTRACT Formula to remove characters not inside [brackets] but leave , commas?

I'm trying to create a formula that uses either =REGEXEXTRACT or =REGEXREPLACE to remove all characters not inside [brackets] but leaving the ,,, commas where they are. For example... ➜ Text to ...
3
votes
2answers
822 views

Search a text for specific text, then multiple if statements depending on what's there

I've got a weird question about Google Sheets. First, here's what I've got so far, but it returns an error "Function REGEXEXTRACT parameter 2 value "My Text here" is not a valid regular expression." ...
1
vote
3answers
2k views

REGEXEXTRACT and French accents in Google Sheets

I have the following formula: =REGEXEXTRACT(source!A2,"^[\w\s\À-ÿ]+") where source!A2="Ancien Marché Saint-Jacques (1125, rue Ontario Est)" and I would like to extract Ancien Marché Saint-...
3
votes
3answers
4k views

Finding and removing periods

I'm using a Google Sheets and trying to create a formula to remove a period and anything that comes before it in a cell. For example: idontwantthis.iwantthis I have used this in the past: =(RIGHT(...
3
votes
1answer
104 views

Which regular expression flavour is used by the MediaWiki search and replace dialog?

I recently discovered this search and replace dialog in MediaWiki and have been using it more and more: But I can't seem to find the documentation on it. On the MediaWiki website I always find info ...
1
vote
2answers
374 views

Preventing certain words from appearing on a Google Sheets

Let's say that I have a big Google spreadsheet that multiple users have access to, and I'm not able to control which users have access to it. I have a concern for trolls. How would I prevent people ...
4
votes
1answer
4k views

How can I search Gmail for a Windows activation key?

Somewhere lost in my Gmail is a Windows key. It's by itself in an email but I cannot find it. It's formatted like so: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX If Gmail supported regular expressions it would be ...
2
votes
0answers
881 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
529 views

How to regex extract alpha portion immediately after an underscore in Google Sheets?

Using Google sheets, here's what I'm trying to accomplish: I have data that comes in like this: xta_GAM-1a (61095) xta_SM (61096) xta_GAM2 (61156) xta_GAM-1b (61161) AO CPC ALL GAM AO CPC ALL PA AO ...
1
vote
0answers
466 views

Search Engine that Doesn't Ignore Punctuation? [duplicate]

Possible Duplicate: How to search the internet for terms with special characters Is there a search engine that will not ignore punctuation marks (like $ % & ! @ #...)? I want to search the ...
12
votes
2answers
8k views

Is there a way to automatically extract information from emails (e.g. regex prices on gmail)?

Every month I get an email from my mobile carrier which tells me how much money my contract has cost me the last month, and I'd like to be able to form that into an iOS notification with IFTTT. The ...
1
vote
1answer
400 views

Matching a cell value to a category from patterns table

I'm trying to categorize a cell value in Google Spreadsheets, based on a categories table, so that depending on the value in the cell, the correct category will be determined. Given a categories ...
3
votes
2answers
11k views

Google Spreadsheets Query( “where a matches '/[A-Z+]/' ”) condition

According to Google Query documentation: matches - A (preg) regular expression match. haystack matches needle is true if the regular expression in needle matches haystack. Examples: where ...
1
vote
2answers
399 views

How do I use regexmatch inside sumproduct?

This works: =sumproduct($J$6:$J,($A$6:$A="Order")*($G$6:$G="T8")) This does not. =sumproduct($J$6:$J,($A$6:$A="Order")*(Regexmatch($G$6:$G,"T8")) produces formula parse error. This =regexmatch(...
2
votes
2answers
1k views

Google Search with Regular Expressions [duplicate]

Is it possible to use regular expressions or very simple regular expressions in google search? Like search the term "goog?e", where the ? indicates a character or a number.