Re: [PHP] Extract printable text from web page using preg_match

2007-02-27 Thread Martin ZvarĂ­k
I believe it is better to use strpos() in this case because it's faster. ?php $start = strpos(strtolower($website_code), 'body'); // not necessary $end = strpos(strtolower($website_code), '/body'); $code = substr($website_code, $start, $end-$start); echo strip_tags($code); // clean text ?

[PHP] Extract printable text from web page using preg_match

2007-02-27 Thread M5
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

Re: [PHP] Extract printable text from web page using preg_match

2007-02-27 Thread Satyam
- Original Message - From: M5 [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, February 27, 2007 6:47 PM Subject: [PHP] Extract printable text from web page using preg_match I am trying to write a regex function to extract the readable (visible, screen-rendered) portion

Re: [PHP] Extract printable text from web page using preg_match

2007-02-27 Thread Richard Lynch
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

Re: [PHP] Extract printable text from web page using preg_match

2007-02-27 Thread M5
On 27-Feb-07, at 1:44 PM, Richard Lynch wrote: 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