Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
([a-zA-Z0-9\\-_]+)=(((["'])((\\{2})*|(.*?[^\\](\\{2})*))\4)|[^\s,]+)[,[\s]*]?
/
mgiu

Description

Handful regex for parsing Authorization, WWW-Authenticate etc. headers

Submitted by Alex Furnica - a year ago