A regular expression to match all parameters (anything after the ?) in a URL.
/(\?|\&)([^=]+)\=([^&]*)/g
Matches:
- https://regexpattern.com/query.php?query=true¶=123&bar=456
- https://regexpattern.com/query.php?query=¶=123&bar=456
- https://www.behance.net/search?sort=published_date&search=free%20psd
Non-matches:
- https://regexpattern.com/#/a=1&b=2
See Also:
- URL (With And Without Port Number) Regular Expressions
- Regex To Match One Parameter In URL Query String
- Regex To Extract Domain Name From URL
- Regular Expression To Match All URLs In Text
- Regex To Match The Last Path (Segment) Of A URL