in reply to Search and replace everything except html tags

  1. You cannot do this line by line as there may be some html on the same line as some text.
  2. eq does not use perl Regexp
That being said, here is a script that will do what you want. It is completely horrible as it is 2am but it will start you down the correct path. I'm sure others around here will have a more concice way of doing it.
open IN_FILE, "<temp.html"; while(<IN_FILE>) { my $text = $_; my $before; my $tag; my $after; while ($text) { if( ($before,$tag,$after) = ($text =~ /(.*?)<(.*?)>(.*)/) ) { print "text: $before\n" unless $before eq ""; print "html: $tag\n"; $text = $after; } else { print "text: $text\n"; $text = undef; } } }
Cheers!
---
crulx
crulx@iaxs.net