Regular Expressions 101

Community Patterns

1...56789...901

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
^"([^"\\]*(?:\\.[^"\\]*)*)"$
/

Description

Validate a line in quotes. Return one (and only one) backreference with the text. ie: quoted text from "quoted text".

Note: a \ escapes any char, so " is a valid escape.

Submitted by anonymous - 2 months ago