Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created July 25, 2014 11:08
Show Gist options
  • Select an option

  • Save lmartins/a75d71b0cf787870ce9d to your computer and use it in GitHub Desktop.

Select an option

Save lmartins/a75d71b0cf787870ce9d to your computer and use it in GitHub Desktop.
Extract the number at the end of a string
var re = /[a-zA-Z]+([0-9]+)/;
var result = re.exec("portsConfiguration23");
console.log(result[1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment