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
/
^(?!(?:.*?{{REPLACE}}){2}).*?{{REPLACE}}
/
gm
Input 1
New
{{REPLACE}}. // Valid {{REPLACE}} {{REPLACE}}. // Invalid {{REPLACE}}{{REPLACE}}. // Invalid Text here {{REPLACE}}. More text here. // Valid {{REPLACE}} text here {{REPLACE}}. More text here // Invalid