Community Patterns

Community Library Entry

1

Regular Expression
Created·2024-10-08 16:14
Flavor·PCRE2 (PHP)

/
^"([^"\\]*(?:\\.[^"\\]*)*)"$
/
Open regex in editor

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