Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Trouble capturing multiple groupings in regex

by Ratazong (Monsignor)
on Dec 09, 2015 at 14:43 UTC ( [id://1149774]=note: print w/replies, xml ) Need Help??


in reply to Trouble capturing multiple groupings in regex

The following works for me:

my $input1 ="<span color=\"#231f20\" textOverprint=\"false\">%PN1%</sp +an>"; my $input2 ="<span color=\"#231f20\" textOverprint=\"false\">%DIMMM%%D +IMINCH%</span>"; my @matches = $input1 =~ m/%([^%]+)%/g ; print @matches,"\n"; @matches = $input2 =~ m/%([^%]+)%/g ; print @matches[0],"___",@matches[1],"\n";

HTH, Rata

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-24 06:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found