in reply to Re: How to Modify Only Non-Quoted Words?
in thread How to Modify Only Non-Quoted Words?

Don't know if it's relevant to the problem but both your and ikegami's solutions fail when contractions enter into the "word" list.

  • Comment on Re^2: How to Modify Only Non-Quoted Words?

Replies are listed 'Best First'.
Re^3: How to Modify Only Non-Quoted Words?
by ikegami (Patriarch) on Aug 31, 2004 at 05:49 UTC

    If you want to escape quotes oustide of quoted strings, change

    ( # $2 [^\s"']+ # Something to prefix. )

    to

    ( # $2 (?:[^\s"'\\]|\\.)+ # Something to prefix. )