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
/
(?<!\\) (?<code_all> (?<code_start>\`{1,}) (?<code_content>.+?) (?<!`) \g{code_start} (?!`) )
/
gx
Unit Tests
foo
`bar`
→ capture group 0 starts with
empty string
```
<p>```
~~~
<p>```
```
→ regex does not match
`<test
a="`
content
of
attribute
`">`
→ capture group 0 starts with
empty string
Fix
for
backticks
within
HTML
tag:
<span…
→ capture group 0 starts with
empty string
Here's
how
you
put
``
`backticks`
``
in
…
→ capture group 0 starts with
empty string