Dear monks,
I've regex below that's used to catch an input (a sentence) that contains illegal characters. I'm puzzled why I needed to escape the $ sign to make a digit "0" not matched i.e. with $ unescaped, a string such as "hello there0" is matched (so not okay), with $ escaped, the same string is not matched (so okay)
if ($input =~ /[<>@#\$%^&*()_+=|\{\}\[\]\/\\]/) { print "not okay"; } else { print "okay"; }
Please enlighten me and many thanks in advance.
In reply to Regex help by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |