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
"
(?<!\{)(\{{3}[^{}\n]*}{3}|\{{2}[^{}\n]*}{2})(?!})
"
gm
Input 1
1
1. "{{example}}" -> match: example 2. "{{{example2}}}" -> match: example2 3. "{{example3}}}" -> do not match 4. "{example4}" -> do not match 5. "{{{example5}}" -> do not match 6. "{{{{example6}}}}" -> do not match 7. "{{ example7 }} some other words {{{example8}}}" -> match: example7 and example8 8. "{{{example9}}} some other words {{example10}} {{example11}}" -> match: example9, example10 and example 11
Substitution
1. "{{example}}" -> match: example 2. "{{{example2}}}" -> match: example2 3. "{{example3}}}" -> do not match 4. "{example4}" -> do not match 5. "{{{example5}}" -> do not match 6. "{{{{example6}}}}" -> do not match 7. "{{ example7 }} some other words {{{example8}}}" -> match: example7 and example8 8. "{{{example9}}} some other words {{example10}} {{example11}}" -> match: example9, example10 and example 11