67 questions
0
votes
1
answer
70
views
How to regex replace a repeated sequence?
For example, if there a sequence of 2 or more :0000: then I like to replace them with :.
In the code below, the result should be 2a00:1450:4028:805::00001111:2005 but it just ignores the replacement.
...
1
vote
2
answers
58
views
Regex optimization for legacy data to json
I have a legacy data format which looks similar to Json. An example is shown in the code block below:
1 {
2 base = {
3 attributeNumericName = V1D,
4 attributeName = hello,
5 ...
0
votes
0
answers
30
views
Regex expression for Mariadb query
I am trying to do a replace on the following string where the last five digits are different in each row-
Stipends
I understand that I should be able to do this with Regex replace but am struggling ...
0
votes
3
answers
99
views
Regex pattern to replace any occurrence of {...} with actual values
I am trying to create a method that will allow me to replace any occurrence of {....} string with some values.
Let me give you an example:
public const string ProductsApi = "/api/companies/{...
0
votes
1
answer
60
views
How Do I End My Powershell Regex Syntax Torture? [duplicate]
I want a Powershell regex replace command to convert strings such as these...
RedHerringFallacy
SunkenCostFallacy
FalseDilemmaLogic
AnyOtherCamelCapString
to...
Red_Herring_Fallacy
...
-2
votes
1
answer
51
views
Regex to replace specific word/phrase in delimited list [duplicate]
I'm trying to get Java regex working to replace specific phrases in a comma-delimited list. It should also match/replace the leading comma, and any leading/trailing whitespace. I have to use strictly ...
-3
votes
2
answers
89
views
Regex to replace specific word in delimited list [closed]
I'm trying to get Java regex working to replace specific phrases in a comma delimited list.
For example I have a string of "BIG BOAT , GREEN CAR,BIG BOAT, YELLOW TRUCK, BIG BOAT, AMAZON ECHO, ...
0
votes
1
answer
44
views
Is there a way to remove leading and trailing substrings without custom code?
Can you remove leading-and-lagging characters-and-substrings from a string without using RegEx-and/or-Custom-Code?
For example, I want to remove leading https:// and lagging / (backslashes).
I can ...
1
vote
1
answer
58
views
Powershell Remove part of Video filename containing Square/Round brackets and everything inside those brackets
I have several videos that has either round brackets and/or square brackets with some text inside those like (ANTYHING HERE) OR [ANTHING HERE]:
For example:
MOVIENAME 2024 LANG [SOMETEXTHERE] 1080P....
-2
votes
1
answer
231
views
GOOGLE SHEETS: Adding letters to the end of words, replacing specific letters with other letters (Concatenate, Regexreplace, Textjoin?)
PLEASE REFER TO THE FOLLOWING SHEET:
https://docs.google.com/spreadsheets/d/1gz5VHxyn3L2-Y_TQwSrp6LryIvTFxl3N17Da7LSzDaA/edit?usp=sharing
I've used CONCATENATE in column C to add the letter(s) in ...
-1
votes
1
answer
166
views
Google Sheets: Use a Conditional Function to separate a sentence in one cell into multiple parts in subsequent cells
I want to separate a one-cell sentence into cells of 4 words each in the same row.
If the sentence has more than 12 words, the 12th word should append "..." and add no more words. SPECIAL ...
0
votes
1
answer
189
views
In Google sheets, importing columns from another file using IMPORTRANGE. The inputted columns contain umlauts, causing problems when using ORDER BY
I am using the IMPORTRANGE in Google Sheets combined with the QUERY function to import columns from another file, with ORDER BY. This sorting then needs to be matched with the normal column-sort ...
1
vote
2
answers
132
views
Regular expression with negative lookahead and negative lookbehind to check if my match IS NOT between [[ and ]]
I'm trying to write a Python script which replaces occurrences of given keywords, in given md file, by themself between [[ and ]].
It will be used several times on the same files, so I don't want to ...
0
votes
1
answer
310
views
How to remove strings and punctuation from a columns using SAS or PROC SQL?
I have a column with a lot of company names without any cleaning as below. But I want to do the cleaning to remove a list of strings from company names so I can group them together.
list of strings: ...
0
votes
1
answer
180
views
How to extract a figure from a long line of text with different kinds of characters using REGEXREPLACE in ACL (Highbond)
I have strings in this format in a column called "Charge_Details" with minor differences: SBLC FEE
<> 1 - 360 day*!<> 400,000.00 USD<> 08/02/18 - 17/12/18 312 <>9
I'...
0
votes
1
answer
4k
views
RegEx Replace for Azure AD SAML Transformation Using RegEx
Long time lurker, first time poster :-)
I have an issue where our vendor does not appear to accept special characters such as hyphen (-) and apostrophes ('). Is that the plural?
So in our Azure Active ...
-1
votes
1
answer
102
views
How to replace a part of a string maintaining the other one intact in IntelliJ or VSCode? [duplicate]
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 ...
0
votes
1
answer
62
views
oracle - replace value in string by excluding case when value is between parentheses
i would like to do an automatic replace with an oracle query in multiple strings available in an oracle table, by changing fields separator ','between first occurrence of 'select' and first occurrence ...
-2
votes
1
answer
69
views
Using regex to replace a string that is not the replace string
I would like to replace all string that do not equal this: readWriteDataGroup="Everyone" on a file I have open in Notepadd++. One of the strings that it will need to replace has this string: ...
0
votes
1
answer
97
views
Is there a function to replace matched string with another column's value?
Im trying to replace a matched string only - and nothing else within the column, with another value.
For example:
My name is GaryBrooks.
The Partnertime series was good.
Match:
GaryBrooks
Partner ...
0
votes
0
answers
32
views
RegEx Replaces Duplicate Character Sequences but Removes Dots and Commas Entirely (but Shouldn't)
I'm trying to write a regex for replacing sequential occurrence of specified characters with single ones. I used a backreference and character class for that. However, some of the characters (. and ,, ...
2
votes
1
answer
72
views
Replace Character Only if it isn't Immediately Preceded By Specified Character
Given a multiple line string A;1;\nB;2\nC;3. It's needed to add a ; before those newline characters that are not immediately preceded by ;. So, the result should be A;1;\nB;2;\nC;3 (a single ; is ...
0
votes
1
answer
227
views
Replace nth regex match in C++
I've found this topic which only explains how to replace the first regex match. What about some n'th match?
Say I have a string and a regex like these:
std::string str = "fast cast dust crust ...
0
votes
2
answers
757
views
How to replace string in column names of pyspark dataframe?
I have a pyspark data frame that every column appends the table name ie: Table.col1, Table.col2...
I would like to replace 'Table.' with '' (nothing) in every column in my dataframe.
How do I do this?...
0
votes
1
answer
76
views
Regexreplace $ in address
I would like to get rid of "$" in several cells.
A cell contains f.e. "$q$3", but I would to change it into "Q3"
How to fix this with function regexreplace?
Anyone? ...
-2
votes
1
answer
90
views
Regular expression for finding the first character of every line
I need to find the first character of all the lines and remove it using Java.
Input lines:
Z301052023KDE12 0000.062500000 0000.000000000 0000.000000000
Z301052023KDE11 0000.000000000 0000....
3
votes
3
answers
748
views
How to replace repeating words with single version of that word
I am trying to process transcripts that appears to use voice to text with C#. One major issue I am running into is repeating words and or phrases. I would love to use a RegEx expression to replace ...
0
votes
1
answer
145
views
How to access sql column that is in a map,string,struct,array,string
I have a table in sql that is map,string,struct,array,string.
I have accessed the value by using element_at(k,v) which works.
My issue is the column has values like '#"nike"#','#"REEBOK&...
0
votes
1
answer
56
views
regex stop continuous match when reach specific symbol
I want to remove character other than letters and number between two symbol which are < and > with empty string. The string is <F=*A*B*C*>
(?<=F=|\G(?!^))[A-Za-z1-9]*\K[^A-Za-z1-9]+
/...
0
votes
1
answer
241
views
How to make function as third parameter of regex_replace() in C++11 above?
I was attending to replace some characters in an abnormal json string in order to make it normal, so i used regex to match it and replace it in line, the matched character need to be transformed, so ...
0
votes
1
answer
81
views
Highlighting dots in a string using Python's regex and termcolor causing jupyter to crash
This is a simple code which uses regex to identify a pattern and termcolor to replace the pattern with the highlighted version of the same, basically used for highlighting a required text. The code ...
1
vote
1
answer
149
views
Google App Script - Web App - Not saving forum data in Google Sheets in the correct format
Here is a Google App Script Form that I created to save submissions into a Google Sheet.
Code.gs
function doGet() {
var template = HtmlService.createTemplateFromFile('Page');
return template....
1
vote
1
answer
71
views
Need a regex that captures date & amount fields & ignore blank lines & other miscellaneous data
Goal:
Capture only the purchase date, amount, and purchased item name(s).
Ignore all blank lines
Ignore Reference # & SHIPPING AND TAX string
Then, repeat this on the next grouping of purchases.
...
1
vote
0
answers
77
views
How do I run a regex replace on all elements of a list of Strings in HQL?
I have the query:
@Query("SELECT t FROM thing t WHERE t.code in :codes") public List<Thing> getThingsByCodeList(@Param("codes") List<String> codes);
and now I need to ...
0
votes
1
answer
106
views
Want file in CSV. I need a Regex to change a space to a comma on each line EXCEPT the Description Field which should remain with a space
Goal:
I want a CSV file as my result. I want to change the space char to a comma on each line of data. BUT, I also need the data for the 3rd field (Description) to remain as is with original space ...
0
votes
2
answers
146
views
Split email address by username and email domain
I would like to split the username and email domain from an email address.
For Example, [email protected] to test.leo and **gmail ** without .com
Formula used: =IFERROR(SPLIT(REGEXREPLACE(INDEX(...
1
vote
2
answers
73
views
regular expression to remove all other words except the words between special characters in notepad++
I am trying to create a regex in Notepad++ to remove words except those enclosed between special characters. I am using this regex \<.*?\> which removes the words along with text.
Eg:
Sample ...
-2
votes
1
answer
310
views
Complex REGEXREPLACE with dots and special symbols in Google Sheets
I'm trying to extract values from the text (column A) into three columns with array formula in each column:
Name (column C)
Text with numbers, dots and special symbols (like ',&,’) written ...
0
votes
3
answers
985
views
Extract text from a cell without extracting punctuation in Google Sheets
In Column F, I have a list of states and their abbreviations.
enter image description here
I want to use a regex function to extract the state and the state code so the output looks like the contents ...
0
votes
0
answers
98
views
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 ...
0
votes
1
answer
364
views
How can I comment all the uncommented lines in a file using puppet module?
I have a sshd_config 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 ...
1
vote
1
answer
222
views
PostgreSQL regex_replace substitution for 2 groups
I have column in Postgres db which has text in char varying data type. The text includes an uri which contains file name and resembles as below;
The file is a file of \\88-77-99-666.abc.example.com\...
3
votes
3
answers
99
views
Regexreplace all lowercase words not working with german umlauts
Trying this to replace all lowercase words is not working properly
=regexreplace(A1;"\b[a-züöäß]+\b";"")
Example sentence:
Mit Sätzen wie Gewinne laufen lassen Verluste begrenzen ...
0
votes
1
answer
194
views
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
...
0
votes
1
answer
257
views
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',
...
1
vote
3
answers
966
views
Regex replace last part of url path if condition matches?
I am basically trying to remove the last part of a URL if the URL contains the path /ice/flag/. Example:
Input:
https://test.com/plants/ice/flag/237468372912873
Desired Output:
Because the above URL ...
0
votes
1
answer
966
views
How would I import YouTube video views into google sheets?
I have a list of videos for which I want to easily see the number of views. Is there a way to do that with REGEXREPLACE, or some other way?
1
vote
1
answer
257
views
mySQL regex_replace remove all beginning numbers from mixed input
I need a regex pattern to remove all numeric input from the beginning of a field that stops at the first alphabetic character and leaves any remaining numbers that follow alphabetic characters.
Here ...
-1
votes
1
answer
429
views
How use REGEXREPLACE in google sheets?
I import data via IMPORTXML and get it in the form as shown in column A:B
How can I use REGEXPREPLACE to bring them into the form as I showed in columns D:F ?
With the price I tried
ARRAYFORMULA(--...
2
votes
3
answers
3k
views
How do I replace a certain char in between 2 strings using regex
I'm new to regex and have been trying to work this out on my own but I don't seem to get it working. I have an input that contains start and end flags and I want to replace a certain char, but only if ...