Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^2: Help with this simple regex

by Jim (Curate)
on May 28, 2013 at 20:01 UTC ( #1035714=note: print w/ replies, xml ) Need Help??

in reply to Re: Help with this simple regex
in thread Help with this simple regex

I modified your regular expression pattern slightly to avoid matching beyond the closing quote.

use warnings; use strict; while (my $line = <DATA>) { while ($line =~ m/event="([^("]+)[^"]*"/gi) { print "$1\n"; } } __DATA__ <ID="user_one" event="open(2)"> <ID="user_one" event="system booted"> <ID="user_one" event="system booted"><ID="user_one" EVENT="init(1m)"> <ID="user_one" event="init(1m)"> <ID="" event="">

Comment on Re^2: Help with this simple regex
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1035714]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2016-02-12 20:36 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (413 votes), past polls