Re: Re: invalid range
| From: | Morgan Hughes | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Re: invalid range | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126766@lists.php.net to get a copy of this message | ||
On Mon, 2 Dec 2002, Nick Eby wrote:
> looks like because you have a dash inside your character class; when inside
> a character class the dash is a special character and you'd have to escape
> it
> eregi("^([a-zedv_\.\- ]+)$", $value);
Traditionally in regexes, a dash has to come last, otherwise the regex
engine interprets it as a range. Escaping it may work too, but I've
never had trouble moving dashes to the last char in the range, so your
regex would look like this:
eregi("^([a-zedv_\. -]+)$",$value);
--
Morgan Hughes
C programmer and highly caffeinated mammal.
kyhm@kyhm.com
ICQ: 79293356