techie411 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to do a Perl one-liner to replace ONLY the last </TABLE> Tag and replace it with something. I tried the following, but it doesn't work:
perl -pi -e 's/.*<\/TABLE>/REPLACE/' test.htm
The following doesn't just match the last one but also replaces another </TABLE> tag. Any assistance appreciated. Thanks.
perl -pi -e 's/.*<\/TABLE>/REPLACE/' test.htm
The following doesn't just match the last one but also replaces another </TABLE> tag. Any assistance appreciated. Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Match last instance of pattern
by JStrom (Pilgrim) on Nov 05, 2008 at 22:22 UTC | |
Re: Match last instance of pattern
by moritz (Cardinal) on Nov 05, 2008 at 21:59 UTC | |
Re: Match last instance of pattern
by GrandFather (Saint) on Nov 05, 2008 at 22:41 UTC | |
Re: Match last instance of pattern
by ccn (Vicar) on Nov 05, 2008 at 21:59 UTC | |
by lostjimmy (Chaplain) on Nov 05, 2008 at 22:09 UTC | |
by ccn (Vicar) on Nov 05, 2008 at 22:29 UTC |
Back to
Seekers of Perl Wisdom