in reply to RegEx to find the index of the character '@' in an Email address
There are more than one way to do it, not necessarily regex
For example:
my $str = 'MY Name@gmail.com'; my $name = substr $str, 0, index($str,'@'); # OR my ($name) = split '@', $str; # OR my ($name) = $str=~m/(.*?)\@/; print $name;
|
|---|