in reply to Re: Re: Irregular Expression??
in thread Irregular Expression??
This time I have to tell you, you're wrong - sorry.Really? I tested my solution, did you?
Seems to print \'\' for every ' to me.#!/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
Abigail
|
|---|