in reply to Re^2: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
in thread Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
Ha! Someone already found a generic solution 14 years ago....:)
> Re^6: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...) (??{})
DB<1> x "ZBBCZZ" =~ /(??{'(.)\1*'})/g; 0 'Z' 1 'BB' 2 'C' 3 'ZZ' DB<2>
Brillant! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Yet Another Rosetta Code Problem (Perl, Ruby, Python, Haskell, ...)
by eyepopslikeamosquito (Archbishop) on Oct 21, 2021 at 01:01 UTC | |
by LanX (Saint) on Oct 21, 2021 at 04:09 UTC |