XP is just a number | |
PerlMonks |
Re^2: Is there a more functional regex syntax?by kennethk (Abbot) |
on Sep 18, 2012 at 16:56 UTC ( [id://994314]=note: print w/replies, xml ) | Need Help?? |
Or, as an improvement in the regex, /^(?=(\d+))(?:\d+-)?(\d+)$/, so that both $1 and $2 are always defined. So, as 1 line, Or more simply, if you want to keep the variables separate,
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|