View Single Post
Old 12-09-2007, 04:17 PM   #7 (permalink)
Geert
The Contributor
RegEx Guru 
 
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
Geert is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
php Code:
preg_match('/(<!-- Begin cached content .* content "main" -->)/iUs', $szContents, $aMatches);

You can then find it in $aMatches[1].
Small tip. You can speed up the regex by removing the capturing parentheses. You don't need them because the full pattern match is already included in $aMatches[0].
__________________
Kohana - PHP5 framework
Geert is offline  
Reply With Quote