in reply to Simple regular expression problem
As for what I can see, you forgot something:($name,$num) = ($str =~ /^(\w+)(\d{0,}$/) ;
I challenge you to find the mistake :)($name, $num) = # assign string parts to variables ($str =~ # we gonna do regexes! /^ # beginning of the string ( # begin of group \w+ # \w a couple'o times ) # end of group ( # begin of group \d{0,} # \d a couple'o times # why not just \d* ? $ # end of string / # backslash after end of string ) # end of group ; # a semicolon after end of string # unexpected end of line?
|
---|