in reply to skip over an escaped single quote

That's a classic.
s/(?|(')[^'\\]*(?:\\.[^'\\]*)*'| (")[^"\\]*(?:\\.[^"\\]*)*")/${1}SSS$1/gxs;

Replies are listed 'Best First'.
Re^2: skip over an escaped single quote
by Jim (Curate) on Jan 31, 2011 at 00:07 UTC

    I just learned the (?|pattern) "branch reset" pattern from this post. It'll come in very handy—save me shenanigans—I'm sure. Thanks, ++JavaFan!