cspctec has asked for the wisdom of the Perl Monks concerning the following question:
<ID="user_one" event="open(2)"> <ID="user_one" event="system booted"> <ID="user_one" event="init(1m)">
I need a regex that will return whatever is in the quotes of the event="open(2)", but I need the matching to stop if it hits a parenthesis and not stop if it hits a space. Example return of the regex would be:
I don't need the stuff in the parenthesis. I have come up with this:open system booted init
I don't know how to get it to stop at the parenthesis but not stop if it hits a space.match =~ /event="(.+?)"/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with this simple regex
by toolic (Bishop) on May 28, 2013 at 19:41 UTC | |
by Jim (Curate) on May 28, 2013 at 20:01 UTC | |
|
Re: Help with this simple regex
by davido (Cardinal) on May 28, 2013 at 19:46 UTC | |
|
Re: Help with this simple regex
by Anonymous Monk on May 28, 2013 at 21:24 UTC | |
by JockoHelios (Scribe) on May 29, 2013 at 01:14 UTC |