Questions tagged [regex]
Also known as regular expression or regexp, a description of a set of strings, often used for searching and validating strings.
2,102
questions
-1
votes
1
answer
38
views
Add an underscore after numbers in Notepad++
I have a scenario where I have list with some numbers in Notepad++. Here is the sample text:
1-This is item one
2_This is item two
3This is item three
4_This is item five
5This is item six
6 This is ...
0
votes
1
answer
45
views
Insert a char just before a particular set of words using Regex
I want to use GREP/Regex in Adobe InDesign. Following is the sample data:
Rat: a mammal. Camel: an animal who lives in desert. An aeroplane: a machine that flys. The muddy water: water full of mud and ...
1
vote
0
answers
19
views
Find regex pattern and use it in the next set of repeating lines until another like it replaces it
I'd like to find a pattern that rapeats every few sets of the second where I'd like to move it to.
The only example I could think of right now is a file listing; but I've needed this so many times. ...
0
votes
1
answer
28
views
regexp multiple lines grep
I am looking for a correct regexp to return the first match and the new line.
Let's say the logfile is like:
Warning-[ABC] blablabla$
/path1/path2/path3/file
The dollar at the end of the first line ...
1
vote
3
answers
79
views
Which regex can I use to replace Greek capital vocals with tonos to ones without it, in Bulk Rename Utility application?
I would like to replace in a lot of filenames, the Greek capital vocals with tonos, with the ones without it:
Ά > Α
Έ > Ε
Ή > Η
Ί > Ι
Ό > Ο
Ύ > Υ
Ώ > Ω
I know how to replace them ...
0
votes
0
answers
25
views
Apple Numbers RegEx not working as expected (Negative lookahead)
RegEx.Extract Negative lookahead help needed due to what works in RegEx Support website does not work in Apple Numbers
(?<=XYZ((?!\d+).)*)\d+
This is invoice from company XYZ - 1234545 product name ...
-1
votes
1
answer
19
views
regex to find non-price consecutive digits not immediately after certain word for Apple Numbers
0
How to find invoice number from different companies which may have different order of invoice number, unit cost and total cost?
Following is specific example of a company XYZ which I need to get ...
0
votes
2
answers
51
views
adding quotes to set of comma separated IP addresses in notepad++
Please, I have a set of comma separated IP addresses and I want to add quotes to each IP addresses to that I can assign the set a powershell variable and parse each IP address strings in the variable ...
0
votes
2
answers
51
views
How to extract a text in between two patterns (potentially containing floating lookbehind) with only one invocation?
I'm trying to match any characters (except line break characters) in between xxx<1+ whitespaces>" and whitespace.
The format of the input string is the following:
xxx<1+ whitespaces>&...
0
votes
1
answer
43
views
Match a User That Starts With a Single Letter
I've been handed a script written by another and been asked to modify it according to their needs. There's one line that needs to be altered:
if [ "$user" == "nobody" ]
This ...
0
votes
2
answers
39
views
Notepad++ Regex search with characters before and after IP address
I have a huge file with text before and after many IP addresses. I'm trying to extract just the IP addresses that fall within x.x.x.x. The unique characters in the line look something like this:
|SIP=...
0
votes
2
answers
88
views
Using VS Find & Replace Regex across lines
I have multiple instances of code that looks like...
if (condition) {
statements
}
else if (different condition) {
statements
}
ad nauseum (probably, honestly about 100+ different times, and ...
-1
votes
1
answer
57
views
Custom Fail2Ban regex not working as expected
Using the regex filter below:
[Definition]
failregex = ^<HOST>.*Priority: 0
ignoreregex =
Fail2Ban does not detect any of these log entries below.
Mon Apr 1 21:11:29 2024 [**] [1:1000002:1] ...
-1
votes
1
answer
77
views
Search and replace doesn't work with sed busybox. getting sed: unmatched '/' error
I am trying to search a particular string and replace all occurrences within a file.
sed -i -e "s/$search_string/$replace_string/g" $filePath
I keep getting sed: unmatched '/'error on ...
0
votes
3
answers
50
views
Powershell $idValue doesn't write the extracted ID, but writes "TRUE" instead -- why?
I am writing a Windows PowerShell script to split a text file based on a delimiter, and create output filenames with an incrementing number and a captured identifier string.
I've checked for syntax ...