I've got a JavaScript question.
I want to create a regular expression that detects a URL in a given string. I've pasted the regular expression below. It doesn't seem to cover all cases like google.com/index.html?2012 OR www.google.com/dir/file.aspx?isc=2012.
Any ideas on what I need to do to make it work, or perhaps a better regular expression (from somewhere else) that I can use?
("(^|\\s)(((http|https)(:\/\/))?(([a-zA-Z0-9]+[.]{1})+[a-zA-z0-9]+(\/{1}[a-zA-Z0-9\-]+)*\/?))", "i")