Skip to content

Instantly share code, notes, and snippets.

@midnai
Created July 22, 2017 00:02
Show Gist options
  • Save midnai/334c3d67799bf3d91104defe8daeca68 to your computer and use it in GitHub Desktop.
Save midnai/334c3d67799bf3d91104defe8daeca68 to your computer and use it in GitHub Desktop.
Get a substring using regex to remove the part you don't want
var str = '/?token=123ADV';
var result = str.replace(/^(.*)?\=/g,'');
//result = 123ADV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment