I have a list that following is a sample of my list:
Bolt
®1421918Users
Classmates
666138Users
SixDegrees
470621Users$$
PlanetAll
AT308079Users
theGlobe
214442Users
1997
Now I want to keep only number Users from Users lines
For example:
Bolt
1421918Users
Classmates
666138Users
SixDegrees
470621Users
PlanetAll
308079Users
theGlobe
214442Users
1997
I tried following regex in notepad++ but not working:
Find What = ^.*?(\d+Users)
Replace = \1
and tried following regex:
Find What = ^(?!\d+Users).*\r?\n?
Replace = [Empty]
How to fix this regex problem?
>Solution :
You should search using this regex:
[^\n\d]*(\d*Users).*
and replace with '$1
RegEx Details:
-
[^\n\d]*: Match 0 or more of any characters that are not digit and not a line break -
(\d*Users): Match 0 or more digits followed by textUsers. Capture this value in group #1 -
.*: Match everything else till end -
Replacement is
$1which is back-reference of capture group #1