Re: Re: Registerrule(), regular expression for checking url
| From: | Ignatius Reilly | Date: | Thu, 15 Apr 2004 16:05:47 +0000 |
| Subject: | Re: Re: Registerrule(), regular expression for checking url | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11867@lists.php.net to get a copy of this message | ||
And there is a splendid REGEX validation tool: Regex Coach for Windows:
http://weitz.de/regex-coach/
Ignatius
_________________________
"Mike Carter" <mikeatwork@ukonline.co.uk> wrote in message
news:11054A7BC9A71245BCBB9917579325731FA1C0@mail.koa.uk.com...
>
>
> > -----Original Message-----
> > From: Tommy Ipsen [mailto:tipsen@imada.sdu.dk]
> >
> > Ignatius Reilly wrote:
> >
> > > This is not a QF, but a REGEX mistake
> > >
> > > "/" is the regex boundary delimiter.
> > > either choose another delimiter or escape instances of "/"
> > inside the regex.
> >
> > Thanks - I ended up with something like this:
> >
> > $form->registerRule('url', 'regex',
> > '/(^$)|(^(file|ldap|http|https|ftp):\/\/(([a-z0-9\-\.]+\.+[a-z
> > ]{2,6})|([0-9]{1,3}\.){4})(\]?)$)/');
>
> A good place to pick up pre-written Regular Expressions is:
> http://regexlib.com/
> Some nice URL ones there ;-)
>
> Regards,
>
>
> Mike C.
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit
> http://www.messagelabs.com/email
> ______________________________________________________________________