Regular Expressions 101

Community Patterns

1...45678...901

Community Library Entry

9

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 - 10 years ago