Reputation: 25
Notepad++ can remove line less than 10 character.
^.{0,9}$
But, if i want remove line have string length than 10 character?
Example:.
hello world, my name Peter.
hello world, mynamePeter.
The string "mynamePeter" have over 10 character, i need remove line container "mynamePeter". How i can do it?
Upvotes: 1
Views: 2948
Reputation: 91488
^.*?\b\w{10,}\b*?(?:\R|\z)
LEAVE EMPTY
. matches newline
Explanation:
^ # beginning of line
.*? # 0 or more any character but newline
\b # word boundary
\w{10,} # 10 or more word character
\b # word boundary
.*? # 0 or more any character but newline
(?:\R|\z) # non capture group, end of line or end of file
Screen capture (before):
Screen capture (after):
Upvotes: 1
Reputation: 29
Use .{10,}\r?\n
for line longer any 10 char.
Or if word with 10 or more: .*\w{10}.*\r?\n
Upvotes: 3