in reply to Simple Substitution

Well, the version you have is very close. Try:

s/([^?]')/$1\n/g;

The $1 is replaced by the contents of the first group. Groups are designated by () in the match portion. So, it matches one non-? and one ' and replaces that with what it found and a \n.

This may be good enough, but keep in mind that it won't work if a ' is at the beginning of the string. A more complete solution would be:

s/'(?<!\?)/'\n/g;

Note that this is untested, but should work! :-)

Ted Young

($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)