Created
July 11, 2014 01:05
-
-
Save kai5263499/7d0920e869f5657ea101 to your computer and use it in GitHub Desktop.
Javascript replace on a capture group
This file contains 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
story = story.replace(person\.go\?ID=\d+"\s*[^>]*>([^(<)]+)<\/a>/g,function() { | |
return 'person.go?ID='+escape(arguments[1].replace(/\./g,''))+'">'+arguments[1]+''; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment