in reply to Re: regexp in win32
in thread regexp in win32

with

\s* (.*) }xm

dont work, dont show any data of the sencond line :/ and i dont understand you solution

Lorn -www.slackwarezine.com.br-

Replies are listed 'Best First'.
Re^3: regexp in win32
by ptum (Priest) on Nov 16, 2005 at 19:08 UTC
    OK, so you can either (a) parse both lines in succession with two different regular expressions (or one very flexible one) or (b) you can join the lines together (with or without the carriage return) and parse the line once. I recommend (b), but if you decide to leave the \n inside your string, you'll want to use the /s flag on your regex. Maybe something like this:
    my $buffer = undef; while (<YOURFILE>) { $buffer .= $_; } if ($buffer =~ /your regex/s) { # do stuff with $1 ... etc. }
Re^3: regexp in win32
by ikegami (Patriarch) on Nov 16, 2005 at 19:23 UTC

    I had join's parameters backwards. Fixed. Tested. Works.

    The test:

    The output:

    Fri Sep 30 14:02:22 2005 Local ESSBASE0 (1051001) Received client request: Logout (from user Procbat)

    (Changed <> to <DATA> for test.)