Last active
August 29, 2015 13:59
-
-
Save leandroh/11000584 to your computer and use it in GitHub Desktop.
simple matching group using regular expressions for verifying street addresses
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
var re = /(.*)\, (.*)\, (.*)/; | |
var str = "Rua tal, 200, Pato Branco"; | |
var newstr = str.replace(re, "$2"); | |
console.log(newstr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment