the inner [] is part of the charclass name. And do not mix ' and " for oneliners. Just start with ' and use " or q or qq in your oneliner on UNIX.perl -e 'if("42"=~ /^[[:digit:]]+$/) {print "42 is a digit\n"} else {p +rint "42 is not a digit\n"};'
In reply to Re: POSIX-Style character classes
by borisz
in thread POSIX-Style character classes
by sub_chick
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |