Previous examples used character classes to specify exact sequences to match. Character classes can also be used to prevent, or negate, matches with undesirable strings. To prevent a match, use a leading caret "^" (meaning NOT), within square brackets, [^...]. For example, the regex [^a] matches any single character except the letter "a".
Example 1: Prevent a match on any numeric string. Use the "*" to match an item 0 or more times.
[^0-9]*
abc c Mail u-see a4a
1 42 100 23000000
Example 2: Search for a text file beginning with any character not a lower-case letter.
[^a-z]\.txt
A.txt 4.txt Z.txt
r.txt a.txt Aa.txt
Example 3: Prevent a match on the numbers "10" and "12".
1[^02]
13 11 19 17 1a
10 12 42 a1