I have a list which following list is a part of my list:
PrtayStetaten2
155,198,293
NrteintenertdoDrtS
154,945,128
GartmertBertoy
119,227,195
PtylytayStytatn3
84,222,289
Xbttyryox36
X84,138,759
etghrth
345
hrhyjuj
0
tytyjhfdff
opop0
2018 Q3
Now i want to remove extra content from value lines only like following:
PrtayStetaten2
155,198,293
NrteintenertdoDrtS
154,945,128
GartmertBertoy
119,227,195
PtylytayStytatn3
84,222,289
Xbttyryox36
84,138,759
etghrth
345
hrhyjuj
0
tytyjhfdff
0
2018 Q3
I can't use following regex because it remove content from non-value lines like 2018 Q3
and PrtayStetaten2
find: ^.*?(?<!\d)(?<!\d,)(\d{1,3}(?:,\d{3})*)(?!,?\d).*
replace: $1
how to solve this problem?
You could use this regex:
^(\D.*\R+)\D+
which matches a complete line starting with a non-digit, followed by some non-digit characters at the beginning of the next line; and replace it with
\1
which will remove the non-digit characters at the start of the second line.
Note:
\R+
with \n
.Regex demo on regex101