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

Re: Splitting string using two overlapping patterns

by oiskuu (Hermit)
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059627]
help
Chatterbox?
[stonecolddevin]: Disciplus i was just amazed he's returned after the thorough stomp that BrowserUk and several other monks gave him for spreading crap info
[stonecolddevin]: i will admit i find the responses to his threads incredibly entertaining
[stonecolddevin]: erix what is this wizardy? there's no sound for me :-(
[stevieb]: he comes and goes every few years.
[erix]: stonecolddevin: oh? Don't know, it works for me
[Sinistral]: stonecolddevin / stevieb - would 'he' in this context (looked at last 50 lines and didn't see discussion) be a certain solar timepiece user?
[stonecolddevin]: Sinistral yes indeed
[Discipulus]: he does not learn, nor teach, nor learn

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-06-22 20:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (529 votes). Check out past polls.