Okay...
> Has anyone got some code that verifies URL syntax.
> I went to the developers exchange and got one called
> <CF_Validate_URL>.
>
> I'm afraid that I'm no guru on Regular Expression so I am not
> sure exactly what this CT is checking.
>
< <cfif attributes.url is not "" and not
> REFindNoCase("^[a-z]+://[a-z0-9:@&=;?%$.+!*'(),-]+(/[a-z0-9:@&
> =;?##%$_.+!*'(),-]*)*$", attributes.url)>
This Regex:
^[a-z]+:// = at the start of the string find 1 or more letters, then a ://
(ie http://)
[a-z0-9:@&=;?%$.+!*'(),-]+ = after the above, find 1 or more of the
characters on the left
(/[a-z0-9:@&=;?##%$_.+!*'(),-]*)* = after the above, find 0 or more
/(characters)
It's not a wonderfully good regex imho. It will work, but will pass
through some useless info too.
Check google for URL validation regular expressions. This has been done
many times in Perl, so...
Paul
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]