in reply to Re^3: Removing the carriage return in a Find & Replace?
in thread Removing the carriage return in a Find & Replace?

The -p option you use splits the input in separate lines. For Perl \n isn't the same as a space even if it is for HTML. One solution is to undef $/ in order to enable ''slurp mode'', (or to use the before mentioned command line option -0):

perl -i -pe 'BEGIN { undef $/ } s/<TD>\s*<FONT\s+FACE=arial\s+SIZE=-1> +/widget/g' test.html

Replies are listed 'Best First'.
Re^5: Removing the carriage return in a Find & Replace?
by bobafifi (Beadle) on Sep 30, 2008 at 16:03 UTC
    How can I use this to batch edit multiple pages? For some reason, I can only edit one page at a time.

    Thanks!
    -Bob