Hi all,

I've got a regex that's working fine, apart from one little problem. 

$tags = array ("script",
foreach ($tags as $currentTag)
  if (preg_match ("/^<\/". $currentTag. "/", $content)) 
    // do something

(checking to see if anything in the $tags array is at the start of the

The problem is that it's not picking up "<!--<![CDATA[" and "]]>-->". I've
escaped the [ and ] as I know they're reserved in regexes, but it seems
there's something else that needs escaping or otherwise tweaking, and all
manner of experimentation has proved fruitless :-(

Can anyone help me out?


Witan Jardine
13 Southampton Place
London WC1A 2AL
Tel: 020 7404 4004

Please visit us on the Internet:

The information included in this e-mail is of a confidential nature and is
intended only for the addressee.  If you are not the intended addressee, any
disclosure, copying or distribution by you is prohibited and may be
unlawful.  Disclosure to any party other than the addressee, whether
inadvertent or otherwise is not intended to waive privilege of

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to