if($line =~ /\s*([a-zA-Z]+\s*)+\s*(-?\d\d?)\s*/) ^
The problem description specifies “at least 1 or more white space” between the last word and the integer, but the regex has \s* (which is zero or more). This should be \s+ (one or more).
Apart from that, it’s difficult to offer advice without more information. Specifically, how is the code failing?
As Kenosis says, please provide some sample data (along with the desired output).
Athanasius <°(((>< contra mundum
In reply to Re: New to perl and regex
by Athanasius
in thread New to perl and regex
by MarvC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |