While fully aware this is likely a duplicate, I simply cannot find a solution to this problem.
How to get a parameter anywhere it exist in a URL?
Consider these urls:
https://any.domain.com/uri-slug/random-string/specific-slug/?version='2'
https://any.domain.com/uri-slug/random-string/specific-slug/?paramOne=1&version=2
https://any.domain.com/uri-slug/random-string/specific-slug/?paramOne=1¶mTwo=2&version=2
I want to get version=2
out of these URLs.
This Regex will return true
if version=2
starts the parameters, but not if it's after the first param.
https:\/\/(\w)+.domain.com\/(\w)+\/(\S)+\/specific-slug\/[?&]+(version=2)
How can I get version=2
to return true if it's present anywhere in the parameters?