in reply to Regular Expression on special character and alphanumeric values

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"; };