When ran, it prints mail=asdf.com. I'm trying to get asdf@123.com. I've tried several ways of quoting it but to no avail. Can someone give me a quick bit of assistance?my $line = "mail: asdf@123.com"; if ($line =~ /mail: /) { my $mail = substr($line, $+[$#+] ); print "mail=$mail\n"; }
In reply to Problem with ampersand and regex by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |