in reply to Parsing and \G and /g and Stupid User Tricks: Correction
in thread Parsing and \G and /g and Stupid User Tricks

that should be:
m/\G.*(MEH|MED|MMD|MMS|CR1|FR1)/ig
or
m/\G.*(?:MEH|MED|MMD|MMS|CR1|FR1)/ig
if you don't want to capture it. just a minor point, but that could break the code.

also, instead of iterating repeatedly with the loop to find pos(), you could set pos() to $currpos and work from there (you'd have to match two more times, i think). that'll make it a little faster.

jeff

Replies are listed 'Best First'.
Parsing and \G and /g and Stupid User Tricks:pos() = $currpos
by THuG (Beadle) on Aug 08, 2000 at 20:04 UTC
    I can set pos() to $currpos? Rock on! I knew there had to be a way to start from where I left off, and not the beginning of the file.

    -Travis