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
/
(COT|MED)[AB]?-?[\dJK]{1,8}(\s+D{1,3})?\b
/
gm
Input 1
1
MED-125 COTA-1224 MED4 COTB-892K777 MED-33 DDD MED-12J44445 MED-234J5672 COT-11161K11111111111111
Extraction
MED-125 COTA-1224 MED4 COTB-892K777 MED-33 DDD MED-12J44445 MED-234J5672 COT-11161K11111111111111