Re: Regular Expression Problem continues
| From: | Rasmus Lerdorf | Date: | Thu, 28 Mar 2002 10:33:16 +0000 |
| Subject: | Re: Regular Expression Problem continues | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90501@lists.php.net to get a copy of this message | ||
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
>