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
/
(AB(?:[0-9A-Z]{5}|[0-9]{4}))(?:\s+)
/
g
Input 1
1
New
foo AB0001 AB0002 foo foo AB0003 foo AB0004A AB0004.1 AB0005.1 foo AB0005A bar AB0005