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
/
^(123-(?:(?![aA][a-zA-Z]*).*)-456)|(123-456)$
/
mg
Input 1
1
New
123-456 123-7-456 123-Apple-456 123-0-456 123-Alphabet-456 123- -456 123--456 123-b-456 123-bbbbb-456 123-Hello-456
Substitution
123-456 123-7-456 123-Apple-456 123-0-456 123-Alphabet-456 123- -456 123--456 123-b-456 123-bbbbb-456 123-Hello-456