New answers tagged regex
1
vote
How to remove extra space (nbsp) at the of every line in Notepad++
Use \h that stands for any horizontal space, including nbsp.
Ctrl+H
Find what: \h+$
Replace with: LEAVE EMPTY
TICK Wrap around
SELECT Regular expression
Replace all
\h+$ matches any number of ...
- 16.4k
-1
votes
How to remove extra space (nbsp) at the of every line in Notepad++
Without knowing even the basics of Notepad++
Search for regex \xa0+\x0a and replace with \0x0a i.e.
Any number of (as by regex +) NBSP with a following LF and replace by just LF.
Now if that is on Mac ...
- 8,434
1
vote
How to remove extra space (nbsp) at the of every line in Notepad++
It's very simple when using regex.
Find what : ( | )+$ (note the starting blank and the special character)
Replace with : (nothing)
Check : "Regular expression"
Note that the characters ...
- 437k
0
votes
perl extended regex pattern with (condition) behaves wrong, what I do false?
I assume you wanted a non-capturing group using (?:) around the whole expression in the 3rd and 4th example. If so, the colon is missing in your expression, so the following lines are working.
perl -...
- 11
0
votes
AWK: "invalid regexp: Invalid collation character" -- how do I make it valid?
I would also try setting LC_ALL. It appears to be empty in your locale output.
LC_ALL=en_US.UTF-8
If you still can't get multi-byte characters set to work, try running AWK with POSIX and see if that ...
0
votes
Matching exact word with special character
@hello#(?!\d)
this matches @hello# not followed by a digit.
Demo & explanation
- 16.4k
1
vote
Accepted
Use PCRE2 Regex to group phrase before colon AND group comma separated values
Using PCRE2, language independant, I'd use:
(^[^:]+:|\G(?!^))\h*([^,\r\n]+),?
Demo & explanation
- 16.4k
1
vote
Use PCRE2 Regex to group phrase before colon AND group comma separated values
This regex should work for your case if I understood correctly:
(?:^|\n)([^:]+):|(?:\s?)([^,\n]+)(?:,|$)
Basically, first you match anything from the start of line or newline until a colon (?:^|\n)([^...
- 496
1
vote
Accepted
Use REGEX only to group multiple key value pairs on line with anchoring text?
Here is a solution using PCRE2 flavour:
(^(?:Steps|Model|Mirror Mode)|\G(?!^).+?):\h*(.+?)(?:,\h*|$)
The key to match unknown number of matches is \G that restarts the match from the last match ...
- 16.4k
1
vote
Regex filter the value and show less than required number
To get versions 23.0.0.17 or older, you could use this for JS:
^((23\.0\.0\.(1[0-7]|\d))|((2[0-2]|1\d|\d)\.\d+\.\d+\.\d+))\S*
As I said in comment below question, this is not really a job for regexes,...
- 496
0
votes
Regex: Delete the contents of all files that start, the first line, with the word ETICHETE:
Ctrl+H
Find what: (^\AEticheta:)([\s\S]+)
Replace with: LEAVE EMPTY
CHECK Wrap around
CHECK Regular expression
UNCHECK . matches newline
Replace all
- 101
3
votes
Accepted
Notepad++ move first two characters to end of line
Ctrl+H
Find what: ^(.+):(.+)$
Replace with: $2:$1
TICK Wrap around
SELECT Regular expression
UNTICK . matches newline
Replace all
Explanation:
^ # beginning of line
(.+) # group 1, 1 ...
- 16.4k
Top 50 recent answers are included
Related Tags
regex × 2013notepad++ × 701
linux × 195
find-and-replace × 184
sed × 178
bash × 158
grep × 144
command-line × 94
microsoft-word × 90
vim × 79
windows × 59
find × 59
sublime-text-3 × 58
windows-10 × 56
powershell × 52
search × 52
text-editing × 48
microsoft-excel × 44
awk × 41
perl × 40
macos × 36
wildcards × 36
text-editors × 35
shell × 34
unix × 31