Questions tagged [regex-replace]
53 questions
3
votes
3 answers
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 them all. Here are some examples:
I, I, I am…

Andrew Harbert
- 75
- 5
3
votes
3 answers
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 können vor
allem weniger erfahrene Aktienkäufer oder…

user3392296
- 644
- 4
- 16
2
votes
1 answer
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 added after 2). I've tried different regexes but…

ENIAC
- 813
- 1
- 8
- 19
2
votes
3 answers
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 it's between the flags.
So for example if the…

Jens
- 23
- 7
2
votes
3 answers
Regex: Remove empty sections from INI (Text) files where the files could contain multiple such sections
I have below resultant php.ini file, after I was able to remove the comments & spaces thro' some simple Regex find/replace steps:
[PHP]
engine = On
short_open_tag = Off
....
....
[CLI Server]
cli_server.color =…

Vicky Dev
- 1,893
- 2
- 27
- 62
2
votes
1 answer
Match URL string on different situations with a single regex
I am trying to match a url in four different situations:
With no attributes
Link without other attr
With other attributes
Link with other…

Álvaro
- 2,255
- 1
- 22
- 48
1
vote
1 answer
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.evaluate();
}
function processForm(form) {
var ss =…

JamesReed68
- 399
- 2
- 14
1
vote
1 answer
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.
I am using Google Sheets for this project.
Sample…

ManniStudio
- 13
- 5
1
vote
0 answers
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 getThingsByCodeList(@Param("codes") List codes);
and now I need to ignore hyphens in the query so I remove all the hyphens from t.codes…

Daniel Burgess
- 11
- 1
1
vote
2 answers
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 text
random text random text
random text …

Nischal Kasera
- 25
- 1
- 5
1
vote
1 answer
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…

Alsheik
- 39
- 6
1
vote
3 answers
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 has /ice/flag/ in its path, I want the last part…

inhwrbp
- 569
- 2
- 4
- 17
1
vote
1 answer
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?

Razmik Badalyan
- 71
- 5
1
vote
1 answer
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 is the simplest test case.
CREATE TABLE tempdemo…

user2132561
- 13
- 3
1
vote
1 answer
Which pattern and substitution for Regex.Replace can replace all space present inside <>?
I have data in a non-standard format which I am trying to convert to intelligible json.
Format is like
dataheads@first{
first_data = ;
second_data = <>;};
I need in this…

Rachit Ajitsaria
- 13
- 8