Re: regular expressions
| From: | Edward van Bilderbeek - Bean IT | Date: | Thu, 21 Feb 2002 15:38:30 +0000 |
| Subject: | Re: regular expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85727@lists.php.net to get a copy of this message | ||
first of all:
why do you use:
[0-9][0-9]*...
you better use: [0-9]+ then
same goes for \w
and I guess you don't need the ('s and )'s either...
Edward
----- Original Message -----
From: "German Castro Donoso" <gecastro@dcc.uchile.cl>
To: <php-general@lists.php.net>
Sent: Thursday, February 21, 2002 5:26 PM
Subject: [PHP] regular expressions
> I have a problem with ereg function.
> In php 4.0.5 i use this
> if ( ereg("([0-9][0-9]*)\|(\w\w*)",$opcion, $registros) ) {
> ...
> }
> and no problem. But, in php 4.1.1 don't work. I think that may be the
escape
> of | character.
>
> Note: I'm looking for a | in the string. Then i need escape the |
>
> Any idea for fix it?
>
>
>
> Thanks
> German Castro
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>