Regular Expressions 101

Community Patterns

Parse Accept-Language

0

Regular Expression
PCRE (PHP <7.3)

/
(.*?)(?:[;|,](?:q=.*?[,|;])?)
/
g

Description

This regex just grabs all the possible languages from the Accept-Language HTTP header.

Submitted by anonymous - 5 years ago