Questions tagged [regex-replace]
53 questions
0
votes
0 answers
Importing cell value from different Google Sheets worksheet and extracting number after searching for string (ADVANCED)
I have a sheet where I need to add a number from another worksheet, but it isn't always in the same cell.
Let me explain: I need to add a formula to access a different Sheets file, search for the words "MONTHLY BUDGET: $2000" ("2000" will change as…

Daniel
- 3
- 1
0
votes
1 answer
How to comment all the uncommented lines in a file using puppet module
I have a configuration file which contains commented as well as uncommented lines. I want to comment all the uncommented lines in that file using puppet. Is there any optimal/simple way to do this? Or is there a way to run bash command (maybe sed to…

anonymous user
- 257
- 5
- 23
0
votes
1 answer
MYSQL Replace string that contains specific substring
Basically, I want to substring all strings that contain the word COMPRIMIDO to keep only COMPRIMIDO
Example:
medication_title
medication_type
medication_result
ZYTIGA 500 MG
COMPRIMIDO REVESTIDO
COMPRIMIDO
VERZENIOS 50 MG
COMPRIMIDO…

Mariana
- 71
- 4
0
votes
1 answer
How to use regexp_replace with contains?
I use this function to find if the pattern is in the column and replace it with the replacement but it does not give.
Can someone tell where I make the mistakes?
patterns = [
'15/19',
'14/11',
'HTP',
'VTP'
]
replacements = [
…

elokema
- 107
- 6
0
votes
1 answer
Google Sheets REGEXREPLACE... after Nth occurrence
I have a list of URLs like
https://www.example.com/inn/abc_name_of_the_product_w/o_additional_information.132.jpeg
I don´t know how they include a slash in the file name... and it could be more than one time in the same file name!
I need to perform…

Speedbit
- 59
- 9
0
votes
2 answers
REGEXP_REPLACE - two letters in a string
I have a string:
string := ',
, \n
, jane, brutus' I have to replace all 'br' marks by '/n' mark. I need an output like this: '/n, /n, n/, jane, brutus' I tried: select regexp_replace(',
, \n
, ania', '^.*((br)[^,]+)',…
, \n
, jane, brutus' I have to replace all 'br' marks by '/n' mark. I need an output like this: '/n, /n, n/, jane, brutus' I tried: select regexp_replace(',
, \n
, ania', '^.*((br)[^,]+)',…
0
votes
1 answer
FILTER + REGEXMATCH + REGEXREPLACE including all special characters in a case sensitive analysis
In cases specific special characters could be added as follows:
=FILTER(D1:D, REGEXMATCH(D1:D, "^("®EXREPLACE(TEXTJOIN("|", 1, A:A),"([().])","\\$1")&")$")=FALSE)
But when wanting to analyze all of them, the best approach would be a negative…

Digital Farmer
- 1,705
- 5
- 17
- 67
0
votes
1 answer
Regex Replace that works with and without trailing slash
I am trying to match a url string and I want to swap when some word is included in this case reviews the problem is that when the url ends on a forward slash my formula adds a double slash. Is there a way to add a slash only when there is no slash…

Álvaro
- 2,255
- 1
- 22
- 48
0
votes
1 answer
Better way to use regular expression
I have a string of account information with multiple accounts in the string (the example shows one line, where I actually have a text file with multiple lines of account data, so there is another loop going through each line in the text file in my…

Infinity Cliff
- 356
- 2
- 6
- 20
0
votes
3 answers
Extract date and name in Oracle sql
I have prg_tbl table in which i insert filenames from directory in the column Filename and values are stored in column Filename as…

Andrew
- 3,632
- 24
- 64
- 113
0
votes
2 answers
Regex expression to capture only numeric fields and strip $ and comma, no match if there are any alphanumeric
I'm trying to write a regex that will strip out $ and , from a value and not match at all if there are any other non-numerics.
$100 -> 100
$12,203.00 -> 12203.00
12JAN2022 -> no match
I have gotten sort of close with…

Dan
- 304
- 2
- 10
0
votes
0 answers
Regex to extract domain from website column
I have a column called 'website' from which I require to extract the domain part only
Examples
www.google.com -> google.com
www.google.com/field -> google.com
https://www.nearbyplaces.com -> nearbyplaces.com
http://hcc.ca ->…

ab_padfoot
- 63
- 1
- 10
0
votes
1 answer
regex_replace on string for string match and not substring match
This:
words = words.withColumn('value_2', F.regexp_replace('value', '|'.join(stopWords), ''))
works fine for substrings.
However, I have a stop word 'a' and as a result 'was' becomes 'ws'. I only want to see it on 'A' or 'a', and leave was as is.

thebluephantom
- 16,458
- 8
- 40
- 83
0
votes
1 answer
Ansible: how to change/replace a port number in a configuration file
I am a newbie in the ansible world and one of the first thing I want to do is to change the default port in a configuration file: /etc/xrdp/xrdp.ini
Every time where value 3389 is found, I would like to replace it by a new value given by the…

Philippe MESMEUR
- 737
- 8
- 22
-1
votes
1 answer
How to replace a part of a string maintaining the other one intact in IntelliJ or VSCode?
I'm developing a Flutter app.
I have used a function written by me to calculate the sizes of every stuff. This was called scaleAdapter and its signature was this one:
scaleAdapter(aNumber)
This is used everywhere in the project.
I recently however…

Ale TheFe
- 1,540
- 15
- 43