in reply to Simple regular expression problem
\w will match alphanumeric characters [0-9a-zA-Z_]. So in your regex \w matches digit also. So change it as shown.
Also you are missing a parantheses in second grouping.
$str = "abdbdr23"; ($name,$num) = ($str =~ /^([a-zA-Z]+)(\d{0,})$/) ; print "$name\t$num\n";
Prasad
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Simple regular expression problem
by Tanktalus (Canon) on Oct 03, 2005 at 14:29 UTC |