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"
([A-Za-z]{1,2})([0-9]{3})(-\w*)?
"
gm
Input 1
1
New
AB001 aB999 Hm000 en789 rv005-ab ab abcfr 158 78532 123ab a1b23
Extraction
AB001 aB999 Hm000 en789 rv005-ab ab abcfr 158 78532 123ab a1b23