There are so many different formats that maybe the best approach is just
to look for the protocol? Something like:

linkRE = /^https?:\/\/\S+$/i;

If the link is not correct, they will see it in the new window! If you
have the CF advanced book, Ben had a regexp to check url's that took
care of most formats. I seem to remember it didn't validate IPs or ports
but most of the rest. I left my copy at work, so I can't verify.

Pascal

> -----Original Message-----
> From: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
> Sent: 03 July 2004 05:20
> To: CF-Talk
> Subject: RE: Regex help
>
>
> > If you are just scanning text to find any links, just look
> > for something like:
> >
> > 'http://[^ "]*
>
> Dick, I have a variation of above which checks for http or https
followed
> by
> a : followed by a an optional www followed by any number of letters,
> numbers
> or periods. I just wanted to make sure I am on the right track
here....
> Basically there is a button next to a form element that when clicked,
> takes
> the link from the form element and opens it in a new window. I want to
> alert
> the user if the link is malformed.
>
> Mike
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to