2005/11/16, Che Sosa <[EMAIL PROTECTED]>: > Thank you eman, > > This is the working one-liner: > > perl -p -i -e 's/<div class="header".*<\/a>\]<\/div>//' *
I don't know Perl syntax. But aren't Perl regular expressions also greedy? What happens if you have two or more <div></div> pairs in one line (a very real possibilty when dealing with machine generated HTML)? Wouldn't that delete all instances between the first <div> and the last </div>? > On 11/15/05, Eman Gardaya Calso <[EMAIL PROTECTED]> wrote: > > > > Try this (NOT YET TESTED) regex: > > /<div class="header"[.|\n]*?<\/a>\]<\/div>//; > > > > The command will be: > > perl -p -i.bak -e 's/<div class="header"[.|\n]*?<\/a>\]<\/div>//' *.txt > > > > Just restore your files from the backups if it's wrong _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List [email protected] (#PLUG @ irc.free.net.ph) Read the Guidelines: http://linux.org.ph/lists Searchable Archives: http://archives.free.net.ph

