I have this regexp
function isValidURL(text) {
var RegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
......
}
And text is: Please use http://google.com or if nothing was found ask your question on http://stackoverflow.com
And i need to extract only first url from text below. (http://google.com)
return as url
Do you mean something like this:
DEMO: http://jsfiddle.net/yh5Zv/