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"
(?<!\\)![^!\\.]*(?:(?:\.(?!\.\.)|(?=(\.{3}.*?\.{3}))\1|\\.)[^!\\.]*)*!
"
gm
Input 1
1
New
!Normal string! !String with escaped \! exclamation mark! !String with a comment ... comment ...! !String \! with both ... comments can have unescaped exclamation marks!!!... ! test ...this is a comment... test \!String \! with both ... comments can have unescaped exclamation marks!!!...... ! !S...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks
Substitution
!Normal string! !String with escaped \! exclamation mark! !String with a comment ... comment ...! !String \! with both ... comments can have unescaped exclamation marks!!!... ! test ...this is a comment... test \!String \! with both ... comments can have unescaped exclamation marks!!!...... ! !S...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks ...test...\!tring \! with both ... comments can have unescaped exclamation marks