Skip to content

Instantly share code, notes, and snippets.

@scheibinger
Created April 27, 2016 03:33
Show Gist options
  • Save scheibinger/b0c896fb066c85e68e9e59d4d1f3e9c0 to your computer and use it in GitHub Desktop.
Save scheibinger/b0c896fb066c85e68e9e59d4d1f3e9c0 to your computer and use it in GitHub Desktop.
handy regex patterns
//transform query string into an object
var queryString = {};
anchor.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment