Re: Extract printable text from web page using preg_match
| From: | Richard Lynch | Date: | Tue, 27 Feb 2007 20:44:45 +0000 |
| Subject: | Re: Extract printable text from web page using preg_match | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-249513@lists.php.net to get a copy of this message | ||
On Tue, February 27, 2007 11:47 am, M5 wrote:
> I am trying to write a regex function to extract the readable
> (visible, screen-rendered) portion of any web page. Specifically, I
> only want the text between the <body> tags, excluding any <script> or
> <style> tags within the document, also excluding comments. Has anyone
> here seen such a regex? Is it possible to do in one expression?
I think http://php.net/striptags may be your best bet...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?