Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(["\'`])((\s|((\\)*)\\.|.)*?)\1
/
g

Description

Catch multiline escaped text between quotes:

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title>Catch quotes</title>
        </head>
        <body>
            <Page data-info='Nobody\'s fool' />
            <CodeCopier text=`
                <h2>It is a</h2>
                <h3>functional component</h3>
                `>
                <h1>Hello World!</h1>
            </CodeCopier>
        </body>
    </html>
Submitted by David Blanchard - 2 years ago (Last modified 2 years ago)