in reply to Re: check if string contains anything other than alphanumeric
in thread check if string contains anything other than alphanumeric
Underscore is not considered an alphanumeric character. It is considered a word character (hence the \w character class.)$ perl -le 'print "hello_world" =~ /^\w+$/ ? "OK" : "BAD"' OK ---> underscore is considered alphanumeric character.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: check if string contains anything other than alphanumeric
by naikonta (Curate) on Aug 12, 2007 at 14:08 UTC |