in reply to Re^2: Supress similar chars in the string
in thread Supress similar chars in the string

Is this a case where adding the /o modifier to the s/// operator might be helpful? It's an efficiency measure intended to ensure (or help ensure, I think) the regex is only compiled once.

s/((.)\2{$n})\2*/$1/go;

Replies are listed 'Best First'.
Re^4: Supress similar chars in the string
by Anonymous Monk on Jan 24, 2011 at 02:38 UTC
    Is this a case where adding the /o modifier to the s/// operator might be helpful?

    No, /o is mostly misused and obsolete , see //o of any help?