Created
May 30, 2011 22:34
-
-
Save trico/999587 to your computer and use it in GitHub Desktop.
Expresión regular para obtener intereses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var re = /%interes%&i=([a-z0-9A-Z]*)&u=(\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"', | |
matched = null; | |
while( (matched=re.exec(text)) != null ) | |
console.log(matched[1] + ' = ' + matched[2].replace('"', '')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment