Maybe just read perlre on how to construct character classes other than \w.
Also, $1 will only have a value if the match was successful, so the correct idiom to use is:
if( $string =~ /.../ ) { print " first is : $1\n\n"; } else { print "Nothing found in <<$string>>\n"; };
In reply to Re: Regular Expression on special character and alphanumeric values
by Corion
in thread Regular Expression on special character and alphanumeric values
by perlmad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |