Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^{{\w+}}(?:_{{\w+}})*$
/
gm
Test String
New
{{word1}}_{{word2}}_{{word3}} _{{word1}}_{{word2}}_{{word3}}. {{word1}}_word{{word2}}_{{word3}} {{word1}}_{{word2}}_{{word3}}word4 {{word1}}_{{word2}}_{{word3}}_ _{{word1}}_{{word2}}_{{word3}}_ {{word1}}_{{word2))_{{word3}} +{{word1}}-{{word2}}_{{word3} word{{word}}_{{word2}}_
Substitution
Processing...