Regex help NOT az or 0-9

I need a regex to find all characters that are NOT az or 0-9

I do not know the syntax for the NOT operator in the regular expression.

I want the regular expression to be NOT [az, AZ, 0-9].

Thanks in advance!

+5
source share
4 answers

This is ^. Your regular expression should use [^a-zA-Z0-9]. Beware: this character class may have unexpected behavior with locations other than ascii. For example, it will match é.

Edited

perl- (PCRE), \s . , . posix, [:space:] (: [^a-zA-Z0-9[:space:]]). [:alnum:] a-zA-Z0-9.

, $ . , , , .

, , , , ?

+12

; ^ , .

, , , ASCII- :

[^a-z0-9]

, , (# ).

+11

Put in ^at the beginning of the expression of your character class:[^a-z0-9]

+3
source
At start [^a-zA-Z0-9]

for condition;
pre_match();
pre_replace();
ergi();

try it

+1
source

All Articles