Morgan Morgan wrote:
I can't seem to find a way to do this.. i have a bunch of html files
that i just need to remove from the <!DOCTYPE to the <BODY> tag on the
top then i need to remove from </body> to </html> on the bottom.
i looked at gsub and i'm learning regular expressions but i can't seem
to figure out how they work. so far i've been able to figure out how to
kill single words and single letters but not whole blocks of letters and
it's mildly frustrating.
well if anyone can help it would be greatly appreciated. i'm off to my
Your regex book will be the best help, but here's a clue: I think you're
going about it inside-out. It would probably easiest to extract the
entire <body> element. It's relatively simple to write a regex that
will cover most cases, but if you have to cover absolutely every valid
thanks in advanced.