greatshots has asked for the wisdom of the Perl Monks concerning the following question:
from a file I am looking for a pattern
and I want to replace the above line as<!DOCTYPE report SYSTEM "http://belief:8081/metrica_reporting/report_0 +1.dtd">
For doing the above task I used the below code<!DOCTYPE report SYSTEM "../../../../../Reporting/bin/report.dtd">
won't I be able to use quotemeta inside the replace pattern ?perl -nle 's/(.*) SYSTEM (.*)/$1 SYSTEM quotemeta("..\/../../../../Rep +orting/bin/report.dtd">)/g; print' 1-report.xml
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using quotemeta in search and replace
by rhesa (Vicar) on Nov 16, 2006 at 02:37 UTC | |
by greatshots (Pilgrim) on Nov 16, 2006 at 02:46 UTC |