perl -e "my $str='foo@bar'; if ($str =~ /@/){ print \"No need to escap +e the \@ in a regex\";}" No need to escape the @ in a regex
or, more nearly parallel to your problem statement, anchoring the start of the line:
perl -e "my $str='@bar'; if ($str =~ /^@/){ print \"No need to escape +the \@ in a regex\";}" No need to escape the @ in a regex
In reply to Re: trouble with @ in a regular expression
by ww
in thread trouble with @ in a regular expression
by efoss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |