in reply to Re: regex issue
in thread regex issue
And as a little explanation of BUU's rather unusal construct (the 2nd half, not the '...' operator itself), a little excerpt from perlop:
The value returned [by the '..'/'...' operator] is either the empty string for false, or a sequence number (beginning with 1) for true. The sequence number is reset for each range encountered. The final sequence number in a range has the string "E0" appended to it, which doesn't affect its numeric value, but gives you something to search for if you want to exclude the end-point.That is what is being tested for with /^\d(?!E0)/. It also becomes clear, that there is a subtle bug lurking here if there are 10 or more lines. To fix that, the regex has to read /^(?>\d+)(?!E0)/.
-- Hofmator
|
|---|