Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
^([a-z][a-z0-9+\-.]*:(\/\/[^\/?#]+)?)?((?:\/[a-z]{4}\/([a-z]{2}\-[a-z]{2})\/)([a-z0-9\-._~%!$&'()*+,;=:@\/]*))(?:\??)(([a-z0-9\-._~%!$'()*+,;:@]+)(?:\=)([a-z0-9\-._~%!$'()*+,;:@\/]*))*(&*)
/
gm

Description

Working on a regex to extract path and query params

Submitted by anonymous - 3 years ago