Created
February 27, 2023 10:08
-
-
Save gargomoma/2cb36d7a9462340e949d41b55235bfb1 to your computer and use it in GitHub Desktop.
exctrac parameters from url
This file contains 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
function extractParam(url,param){ | |
var regex = new RegExp(`(?<=${param}=)[^&]+`); | |
var match = url.match(regex); | |
if (match) { | |
const result = match[0]; | |
return result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment