sherab has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl $text = 'YAY! <a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/ +265-23&file_num=265-23&action=Show_Form" class="subCat9">Click to sub +mit</a> YAY!'; $find='<a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/265-23& +file_num=265-23&action=Show_Form" class="subCat9">Click to submit</a> +'; $replace="This is a replacement"; # Would like to see # YAY! This is a replacement YAY! $text=~s/$find/$replace/g; print $text; # I get # YAY! <a href="/cgi-bin/ruling?candy=265-23&path=/rules/other/265-23& +file_num=265-23&action=Show_Form" class="subCat9">Click to submit</a> + YAY!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex can't find match
by toolic (Bishop) on Apr 07, 2014 at 18:59 UTC | |
by sherab (Scribe) on Apr 07, 2014 at 19:08 UTC | |
by AnomalousMonk (Archbishop) on Apr 07, 2014 at 20:05 UTC |