I'm trying to remove strings with unrecognized characters from string collection. What is the best way to accomplish this?
To remove strings that contain any characters you don't recognize: (EG: if you want to accept lowercase letters, then "foo@bar" would be rejected")
^[A-Z]$
Note: This won't work for strings that contain newlines, but you can tweak it if you need to support that
To remove strings that contain entirely characters you don't recognize: (EG: If you want to accept lowercase letters, then "foo@bar" would be accepted because it does contain at least one lowercase letter)
^
character inside the square brackets, and starts with ^ and ends with $. For example, if your "recognized" characters are uppercase A through Z, it would be ^[^A-Z]$