Regular Expressions 101

Community Patterns

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 - a month ago