It depends on what files you are accepting at the end of the url and if
there can be a query string. Does the protocol have to be there or is it
optional?

Here it is with the specs:
Protocol optional
File optional (only cfm or htm(l) allowed)
File has only alphanumerical & underscores
No query string

Pattern="/^(http:\/\/)?www2?\.mywebsite\.com\/([\w_]*\/)*([\w_]+\.(cfm|h
tml?))?$/i"

(watch for wrap, no spaces)

It's not tested.

HTH
Pascal

> -----Original Message-----
> From: Senkal, N Morgan - TOIS-CSB-2 [mailto:[EMAIL PROTECTED]
> Sent: maandag 15 maart 2004 21:40
> To: CF-RegEx
> Subject: URL validation?
>
> Hi, I'm having trouble developing a regex that will validate
> a proper URL for a specific site.  It should allow
> text,number,underscores seperated by /'s and prepended with a
> specific URL.  I'm trying to use it on a cfinput pattern
> attribute. I'm stumbling over how do deal with these
> acceptable possibilities:
>
> www.mywebsite.com/dir1/dir2/dir4/
>
> www.mywebsite.com/dir1/dir3/default(.cfm|.htm)
>
> but this is not ok:
>
> www.mywebsite.com/dir1/dir1
>
>
> cfinput validate="regular_expression"
> pattern="^[(http://)(www.|www2.)(mywebsite.com/)([a-zA-Z_0-9]$"
>
>
> Thanks in advance,
>
> Morgan
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to