in reply to Re: Regular Expression help
in thread Regular Expression help

Hi Roger, Thanks for the help, this really deepens my understanding of regular expressions. I wonder could you tell me how I could parse it without stripping the date out first with the /\|/ split. In other words is there a way to get a record to parse without splitting?? Once again thanks for the help.

Replies are listed 'Best First'.
Re: Re: Re: Regular Expression help
by Roger (Parson) on Nov 12, 2003 at 01:06 UTC
    Ok, you can change my previous code to -
    my ($activity, $machine, $requester) = /\|1\|(.*)\sfor\s(.*)\s\(reques +ted by (.*)\)/;
    I have omitted the implicit $_ =~ part in the idiom. What the new code does is to look for the |1| pattern followed by the stuff you are looking for. Note that at this point, $_ holds the entire line.