note 63524 deleted from function.preg-match-all by colder
| From: | colder@php.net | Date: | Mon, 16 Apr 2007 17:02:39 +0000 |
| Subject: | note 63524 deleted from function.preg-match-all by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125470@lists.php.net to get a copy of this message | ||
Note Submitter: dave at mixd dot net
----
Use this to capture all JavaScript code that is between <script> tags.
Takes into account javascript that generates HTML. This one took a while, so I thought I'd
share it.
$delimeter =
'/<script[^>]*>((?:[^<>"\']+(?:"[^"]*"|\'[^\']*\')*)+)<\/script>/i';
Note: For some reason php.net is filtering out my escape characters... If it doesn't work make
sure you escape all single quotes and the forward slash.