Regular Expressions 101

Community Patterns

[1]EXTRACT URL GET PARAMETERS

1

Regular Expression
PCRE (PHP <7.3)

/
((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)
/
ig

Description

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

Submitted by — Anonymous - 8 years ago