Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"""
("|')((?!(?!\\)(\1|\n))|(\\(.|\n))|((?!\\).))*?(\1)
"""
g
Unit Tests
"valid
line"
→ full match equals
"valid
line"
'valid
line
2'
→ full match equals
'valid
line
2'
''
→ full match equals
''
""
→ full match equals
""
"'''"
→ full match equals
"'''"
"''''"
→ full match equals
"''''"
'"""'
→ full match equals
'"""'
'""""'
→ full match equals
'""""'
"hello
new
line\
hello
another
line\
end…
→ full match equals
"hello
new
line\
hello
another
line\
end…
'hello
blank
line\
\
end
blank
line'
→ full match equals
'hello
blank
line\
\
end
blank
line'
"broken
line
"
→ full match starts with
empty string
"broken
line
2
\ffd
\hellod
"
→ full match starts with
empty string
'\'
→ full match starts with
empty string
"\"
→ full match starts with
empty string