Regex: Delete all lines containing characters other than [a-z], [A-Z], and [-]
-
Hello.
Thanks again in advance:
I have a list and I want to delete every line, which contains a character which is not
[a-z], [A-Z], and [-].so:
bl-a
bla
blà
bl%
blo
bló
blOshould become
bl-a
bla
bloThank you very much!
-
Hello, @iskandar-the-pupsi and All,
Use the following regex S/R :
SEARCH
^.*[^A-Za-z\r\n-].*\RREPLACE
Leave EMPTYNotes :
-
The
^symbol ,beginning the character class, is the negation character -
The
-symbol must be located at the end of the character class as it’s a special** char inside class character -
The
\Rsyntax matches any kind of line-break
Best Regards
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login