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