picking up regex?
> From: Pascal Peters [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 8:27 AM
> To: CF-Talk
> Subject: RE: _javascript_ to Check link format...
>
> function checkURL(url){
> var pattern =
> /^https?:\/\/[-a-z0-9]+(\.[-a-z0-9]+)*\.([a-z]{2,3}|aero|coop|info|museu
> m|name)\/?$/i;
> return pattern.test(url);
> }
what i have and where i get stuck:
I'll start off with saying I have no idea what the first two characters
represent here (I thought the caret was a negation operator...but I guess
that's just in []). then of course, we have the http with the optional s.
two (escaped) slashes. then any combination of letters or numbers (altho
i'm a bit fuzzy on the - in front of the a-z...does that negate case
sensitivity?). a dot (escaped), once again followed by any combination of
letters or numbers. I'm not sure about the asterisk...or why the second set
of 'any combination of letters or numbers' gets grouped in parentheses.
Once again, an escaped dot, followed by any letter combo of 2-3 letters, or
any of the specified tlds. not sure about the /?$/i at the end.
any clarification on where I'm stuck (or corrections on where I'm wrong)
would be appreciated.
Charlie
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

