I was using:

        $mystring =~ s/\'/\\'/;

...to replace ' with \' in $mystring. It was working find I thought, until I
encountered a string with multiple apostrophies. How do I replace 0 or more?

Ex:

        "No More 'I Love You's'"

...should become:

        "No More \'I Love You\'s\'"

I've tried:

        $mystring =~ s/\'*/\\'/;
        $mystring =~ s/(\')*/\\'/;

...neither of which work.

Any help would be greatly appreciated. And no cracks about the Annie Lennox
song title, it is my wifes' part of our mp3 collection :-)

Thanks,
Patrick

Reply via email to