in reply to Re: Simple Substitution
in thread Simple Substitution

Dragonchild (and all who followed) - thank you. This line did the trick for me:

perl -pe "s/([^?])'/$1'/g" input.txt

Things you folks taught me:

  • grouping in a regex - see perlrequick
  • the special variable $1 - ditto
  • the -p switch
  • the -i switch
  • check code before posting. I had two errors in mine (extra double quote and unnecessary escape)

    Cheers - Winter