Regular Expressions 101

Community Patterns

[1]EXTRACT URL GET API PARAMETERS

1

Regular Expression
PCRE (PHP <7.3)

/
(?:\?|\&)(?<key>[\w]+)=(?<value>[\w+,.-]+)(?:\:?)(?<option>[\w,]*)
/
g

Description

Returns key/value pair of a url. Also works with google fonts which has additional information

Submitted by Anonymous - 8 years ago