RE: [PHP] Regex not working with ":"

From: Date: Wed, 22 Apr 2009 12:22:48 +0000
Subject: RE: [PHP] Regex not working with ":"
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-291808@lists.php.net to get a copy of this message
Have you tried escaping the : with a \? Like: mb_ereg_replace('^(.*)this is the test\: replace(.*)$', '', $contents ,'UTF-8'); Also, have you tried removing the : and adjusting the input string to verify your belief that it's the :? HTH, Kyle -----Original Message----- From: Merlin Morgenstern [mailto:merlin_x@fastmail.fm] Sent: Wednesday, April 22, 2009 4:09 AM To: php-general@lists.php.net Subject: [PHP] Regex not working with ":" Hi there, I am trying to remove a text which does contain a : inside. Somehow the regex does not match, no matter what I do: $contents = mb_ereg_replace('^(.*)this is the test: replace(.*)$', '', $contents ,'UTF-8'); Looks like this is a result of the :. Does anybody have an idea how to do this? Thank you for any help. Merlin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#291808) next »