Stripping all but body from HTML

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
dan.kotowski
Forum Newbie
Posts: 8
Joined: Thu Jul 20, 2006 10:22 pm

Stripping all but body from HTML

Post by dan.kotowski »

I'm fairly new to regular expressions, but I've been looking around for a while and can't seem to figure out how to do this. I need to strip all but the body from an HTML file. So if the file looked like this:

Code: Select all

<html>
<head><title>Hello, world!</title></head>
<body>
This is the text to save.
</body>
</html>
the end result would be this:

Code: Select all

This is the text to save.
How would one do this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

hey look at that, a thread just before yours answers this: viewtopic.php?t=51929 ;)
Post Reply