Remove all numbers + characters from a string in Notepad ++

Is it possible to delete every line in notepad ++ Not containing

a   b   c   d   e   f   g   h   i   j   k   l   m
n   o   p   q   r   s   t   u   v   w   x   y   z

A   B   C   D   E   F   G   H   I   J   K   L   M
N   O   P   Q   R   S   T   U   V   W   X   Y   Z

,   .   '

Like this:

enter image description here

Remove non-ascii

.*[^\x00-\x7F]+.*

Delete numbers

.*[0-9]+.*

Text:

example
example'
example,
example.


example123
éxample è
[example/+
example'/é,
example,*
exa'mple--
example@
example"
+4
source share
3 answers

you can use

^(?![a-zA-Z,.']+$).+$\R?

The regular expression matches any non-empty string ( .+), which does not consist of ASCII letters ,, .or '. \R?at the end there is an optional line break.

More details

  • ^ - beginning of line
  • (?![a-zA-Z,.']+$) - , , : [a-zA-Z,.']+ - 1 ASCII-, , ($)
  • .+ - 1 + , char
  • $ -
  • \R? - char ()

enter image description here

+3

:

: ^.*[^a-zA-Z.,'].*$
: ``

:

  • .*
  • [^...]
  • .*
  • ^...$

, \r?\n $. I.e.: ^.*[^a-zA-Z.,'].*\r?\n

+2

Try replacing all this matching

^.+?[^a-zA-Z,.'\r\n]+(.|\r?\n)
+1
source

Source: https://habr.com/ru/post/1677339/


All Articles