the output is myname.whatever but i just want "myname" can anyone explain why its jumping to the last dot?sub name($) { ($name)= $_[0] =~ m/\@(.*)\./; return $name; } print name('aaa@myname.whatever.com');
In reply to regex extracting text by sweepy838
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |