in reply to Re^2: Elegant way to split into sequences of identical chars?
in thread Elegant way to split into sequences of identical chars?
And not only
elegant++but also by far the fastest solution so far, provided Benchmark not lying to me.
Since it is also very compact already, we get the most compact variant so far with
/((??{'(.)\1*'}))/g
This is not as fast as the precompiled regex, of course, but still faster than the other snippets seen.
|
---|