in reply to I am gating MAD!

Probably failing because you're trying to match across multiple lines. Could try to read the file into a single string and have your regex use the m or s modifier.

For example:

open(I,'<','error.log'); undef $/; $_ = <I>; print "$1\n" if /\s*HELPTEXT\s+(.*)\s*HELP/s;

Of course, you shouldn't use (.*) in matches but if you're really impatient and the input stays this simple (doesn't report multiple errors), this should work.

Replies are listed 'Best First'.
Re^2: I am gating MAD!
by someone202 (Initiate) on Mar 02, 2008 at 08:31 UTC
    Thx, Forgot about the //s flag... Last thing: why this one doesn't work:
    /HELPTEXT\s+"(.+)"\s+/s
    Thx.
      "doesn't work" here means it gets more than you want, I'm guessing?

      The .+ is greedy; it matches as much as possible of your string so long as it is followed by " and whitespace. Use .+? to be non-greedy, or use [^"]+ to match only non-" characters.