[thelist] javascript regexp help!

Edwin Horneij edwin at multiplemediums.com
Fri Jul 5 10:41:01 CDT 2002

On Thursday, July 4, 2002, at 08:27 PM, Erick Papadakis wrote:

> hi, i want to use regexp to find out if a URL entered
> is correct. i am trying the following code:
>     myreg = new
> RegExp("/^(http|https|ftp):\/\/((?:[a-zA-Z0-9_-]+\.?)+):?(\d*)/");
>     if (myreg.test(url)) return true;
>     else return false;

Could you explain what the first question mark is for? I don't
understand its purpose.

-- Ed Horneij

More information about the thelist mailing list