Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Don't ask to ask, just ask
 
PerlMonks  

Re: Splitting string using two overlapping patterns

by oiskuu (Pilgrim)
on Oct 25, 2013 at 11:52 UTC ( #1059627=note: print w/ replies, xml ) Need Help??


in reply to Splitting string using two overlapping patterns

And the 6th way to skin the cat:

while ($str =~ m/{(.+?)}|([\w:]+)/g) { print $+; }
.+? is a non-greedy match-anything. $+ is last captured group.


Comment on Re: Splitting string using two overlapping patterns
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2014-04-18 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls