> "andy" <[EMAIL PROTECTED]> wrote:
>
> > Hi there,
> >
> > I would like to validate a website adress. Unfortunatelly my eregi stmt
does
> > not work:
> >
> >  if (eregi("^@([0-9a-z][0-9a-z-\.]+)\.([a-z]{2,3}))", $website)){ // not
a
> > link
> >
> > I am getting the error msg:
> > Warning: REG_ERANGE in extend.inc on line 94
>
> The second charset: [0-9a-z-\.] has an errant hyphen (-). In this case
> the hyphen should be the first or last character. Also, the . char loses
> its meaning inside square brackets, so you don't need to escape it.
> Eg: [0-9a-z.-]
>
> --
> Richard Heyes
> ___________________________________________________________
> This mail sent using V-webmail - http://www.v-webmail.co.uk
>


I did change the comment to what you suggested:
 if (eregi("^@([0-9a-z][0-9a-z-.]+)\.([a-z]{2,3}))", $website)){ // not a
link

but this seams not to work as well. It is still possible to post a website
like this: http://website
So somehow the last part does not work checking for dot and 2 or 3 char.

does somebody have an idea on that?

Thanx, Andy


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to