in reply to Regular Expression on special character and alphanumeric values

I think the actual regex question has been dealt with. Here a couple of additional tips that I find useful when dealing with regex:

1) Assign directly to a variable without using $1. The list on the left can be expanded, especially useful when there is $2,$3, etc. I prefer to get a meaningful name ASAP.

my ($first) = string =~ /some regex with capture/;

2) Often the //= operator is useful:

$first //= '';
Assigns $first to the null string if it is undefined. Introduced I think in Perl 5.10. You have something that evaluates to false, yet can be printed without an error.