doofus has asked for the wisdom of the Perl Monks concerning the following question:
I want to remove A_D11 no A_D1, how do I remove the exact string? Thanks
my $a ="A_D[1]"; print "Removing $a from \$str\n"; my $str = "123 A_D1 XYZ A_D1[1] BLAH BLAH"; print "str = $str\n"; $str =~ s/\b$a / /; print "str = $str\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing string with []
by AnomalousMonk (Archbishop) on Oct 22, 2015 at 01:44 UTC | |
|
Re: Replacing string with []
by choroba (Cardinal) on Oct 22, 2015 at 08:54 UTC | |
|
Re: Replacing string with []
by Laurent_R (Canon) on Oct 22, 2015 at 08:10 UTC | |
|
Re: Replacing string with []
by hdb (Monsignor) on Oct 22, 2015 at 07:22 UTC |