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
/
([!?]).*\1
/
gm
Input 1
1
New
const string1 = "!hello"; // should return false const string2 = "!hello?"; // should return false const string3 = "!hello!"; // should return true const string4 = "hello ??"; // should return true const string5 = "hello ?test? foo"; // should return true const string6 = "hello ?test ?? foo"; // should return true
Substitution