Created
April 27, 2016 03:33
-
-
Save scheibinger/b0c896fb066c85e68e9e59d4d1f3e9c0 to your computer and use it in GitHub Desktop.
handy regex patterns
This file contains hidden or 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
//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