Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Elegant way to split into sequences of identical chars?

by Roy Johnson (Monsignor)
on Nov 30, 2005 at 18:14 UTC ( #513032=note: print w/replies, xml ) Need Help??


in reply to Re^3: Elegant way to split into sequences of identical chars?
in thread Elegant way to split into sequences of identical chars?

Another curiosity: it is a special feature of m//g that if you don't parenthesize anything, it will return the entire match, so removing the parentheses from your first example changes nothing.

However, removing the outer parentheses from your second example causes a crash on my box (ActiveState 5.8.7).


Caution: Contents may have been coded under pressure.
  • Comment on Re^4: Elegant way to split into sequences of identical chars?

Replies are listed 'Best First'.
Re^5: Elegant way to split into sequences of identical chars?
by jonix (Friar) on Nov 30, 2005 at 19:48 UTC
    Just tried this with perl v5.8.7 on my gentoo linux box at home:
    • /$re/g matches x 5 6 x
    • /(??{$re})/g matches xx 55 6 xx

    Cheers,
    jonix

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2020-01-24 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?