Re: Regular Expression Problem continues

From: Date: Thu, 28 Mar 2002 18:47:36 +0000
Subject: Re: Regular Expression Problem continues
Groups: php.general 
Request: Send a blank email to php-general+get-90571@lists.php.net to get a copy of this message
Rasmus, The code worked fine in PHP Version 3.x It does not work with PHP Version 4.1.1. That is where I have a problem. With Regards, Sharat
From: Rasmus Lerdorf <rasmus@lerdorf.ca> To: Sharat Hegde <sharat_hegde@hotmail.com> CC: php-general@lists.php.net Subject: Re: [PHP] Regular Expression Problem continues Date: Thu, 28 Mar 2002 02:33:16 -0800 (PST) This code works fine: eregi("__([a-z0-9_]+)__", "Hello __WO_RD__ Test", $Matches); echo $Matches[1]; produces: WO_RD -Rasmus On Thu, 28 Mar 2002, Sharat Hegde wrote: Hello, I am still having problems with the regular expressions. Looks like there has been a change in the way they are handled between PHP3 and PHP4, since the code worked with PHP3 !! I need to search for all words having alphanumberic characters as well as _ (underscore) which are prefixed and suffixed with __ (2 underscores). The regular expression I am using is eregi("__([a-z0-9_]+)__", "Hello __WO_RD__ Test", $Matches) I am expecting the above code to return __WO_RD__ as the match, but it does not seem to work. Can someone help out. With Regards, Sharat _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com

« previous php.general (#90571) next »