Skip to content

Instantly share code, notes, and snippets.

@leandroh
Last active August 29, 2015 13:59
Show Gist options
  • Save leandroh/11000584 to your computer and use it in GitHub Desktop.
Save leandroh/11000584 to your computer and use it in GitHub Desktop.
simple matching group using regular expressions for verifying street addresses
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