Skip to content

Instantly share code, notes, and snippets.

@trico
Created June 28, 2011 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save trico/1050747 to your computer and use it in GitHub Desktop.
Save trico/1050747 to your computer and use it in GitHub Desktop.
Extraer todas las urls de una cadena
var re = /http([^"'\s]+)/g,
text = 'href="%interes%&i=SoyUnInteres&u=http://google.es/?%moglaA2%20 texto sobre el texto de textos a mas textos %Q /ht href="%interes%&i=OtroInteres&u=http://popplers.com"',
encontrados = text.match(re);
console.log(encontrados);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment