in reply to Match last instance of pattern

perl -0777 -pe '$_=reverse;s{>ELBAT/<}{ECALPER};$_=reverse' test.htm

Replies are listed 'Best First'.
Re^2: Match last instance of pattern
by lostjimmy (Chaplain) on Nov 05, 2008 at 22:09 UTC

    Are the two reverses (and backward words) better to use than just matching everything before the last </table>?

    perl -0777 -pe 's!(.*)</table>!${1}REPLACE!s;' test.htm

      It depends... How do you compare one JAPH with another?