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
/
(?:^| )(?=.{2,5}(?=$| ))([A-Z]{1,4}[0-9]{1,4})(?=$| )
/
gm
Input 1
New
AAAA1 AAA11 AA111AA A1111 AAAAA1 AAAA1111 A1A1A
Substitution
AAAA1 AAA11 AA111AA A1111 AAAAA1 AAAA1111 A1A1A