Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
PCRE (PHP <7.3)

/
(?| (")((?:\\"|[^"])+)\1 | (')((?:\\'|[^'])+)\1 )
/
xg

Description

Matches single or double quoted strings, and ignores backslash-escaped quotes within the string.

Submitted by Maddingue - 11 years ago