Regular Expressions 101

Community Patterns

URL query param

0

Regular Expression
Python

r"
(?<=(?:[?&]))foo(?:=([^&#]+))?\b
"
g

Description

A solution for capture set/unset/catch a value of param query of URLs.

Here is a example code that applies this pattern in JS, but JS doesn't have support to lookbehind.

Submitted by Rafael Laurindo - 7 years ago