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

Sorry... the m/\G.*MEH|MED|MMD|MMS|CR1|FR1/ig should read
m/\G.*[MEH|MED|MMD|MMS|CR1|FR1]/ig

Minor but.. it does affect things.

-Travis

Replies are listed 'Best First'.
RE: Update: Parsing and \G and /g and Stupid User Tricks
by jlistf (Monk) on Aug 08, 2000 at 19:04 UTC
    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
      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