I am using the RegEx search tool in Sublime. I need to select all lines that contain non alphabet characters (excluding spaces).
E.g.
Hedgehog's shoes
The Fox Machine
The Armadillo`s wish
In the above, the entirety of hedgehog and armadillo lines would be selected, because they contain non alphabet characters. The fox line would not be selected.
Here is my code:
.*[^a-zA-Z\s]
Explanation
.* - Selects string
[^] - Ignore everything in the square brackets
a-zA-Z - Ignores all alphabet characters
\s - Ignores Space
That should work in theory, but it doesn't. It only selects everything up to the offending character, but nothing after it.
Please note, I am looking for a solution that works in Sublime's Find and Replace. If this is not possible in Sublime, then how can I adapt the code so I can search an entire directory of files via the MacOS terminal?
I think doing it in the terminal would be
for f in *; do '.*[^a-zA-Z\s]'
But that doesn't work either.
PS. There are questions about this on Stackoverflow already (Such as this one). But they only deal with selecting the individual characters and not the whole line.