in reply to Re: Irregular Expression??
in thread Irregular Expression??

Normally you correct me. This time I have to tell you, you're wrong - sorry.

The OP really wanted \'\' to appear for every '!

So you're missing the \-part too.

Replies are listed 'Best First'.
Re: Irregular Expression??
by Abigail-II (Bishop) on Feb 26, 2004 at 09:00 UTC
    This time I have to tell you, you're wrong - sorry.
    Really? I tested my solution, did you?
    #!/usr/bin/perl use strict; use warnings; my $str = "A'Bcd"; $_ = $str; s/(')/\Q$1$1/g; print "$_\n"; $_ = $str; s/'/\Q''/g; print "$_\n"; $_ = $str; s/(')/quotemeta "$1$1"/eg; print "$_\n"; __END__ A\'\'Bcd A\'\'Bcd A\'\'Bcd
    Seems to print \'\' for every ' to me.

    Abigail