Regular Expressions 101

Community Patterns

1...45678...180

Quote Macthing with escape

25

Regular Expression
ECMAScript (JavaScript)

/
(["'])((?:(?=(?:\\)*)\\.|.)*?)\1
/
gm

Description

Matches text within quotes (", ') and escapes the charecters.

Submitted by Vihan Bhargava - 9 years ago