<shudder> That works fine in English. But not so good in pretty much any other language. e.g., accented characters and the like, or non-roman languages such as Arabic, Hebrew, Hindi, or pretty much any Asian language. Ok, maybe today you don't support them, but maybe tomorrow? Besides that, this regexp is not self-documenting if you mean to say you want to match "letters". Better to use the POSIX classes documented in perlre:
This does a full unicode match against "alphabet". Which has a very well-defined and globalised meaning.($name,$num) = $str =~ /^([[:alpha:]]+)(\d*)$/;
I'm also unsure why you use "{0,}" - this has precisely the same meaning as "*". Especially when you used "+" instead of "{1,}". Over everything else, be consistant!
In reply to Re^2: Simple regular expression problem
by Tanktalus
in thread Simple regular expression problem
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |