Created
July 7, 2020 02:14
-
-
Save cvan/5554c7a3d7895e192e65f39bb9ecc7fc to your computer and use it in GitHub Desktop.
JS regex one-liner for query-string value parsing
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
// Just replace `placeholder_name` with the actual key for which you want its value. | |
var placeholderName = decodeURIComponent((window.location.search.match(/[?&]placeholder_name=([^&]+)/)||['', ''])[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment