i
Hate
Regex
Library
Cheatsheet
Community
Open playground
Shared by Nelson Eduardo · edit to remix
Regex title
Edit anything to remix
Copy link
Remix in playground
JavaScript
Expression
/
Regular expression
^
(?:
\d
+
|
MK
[A-Za-z0-9]
+
)
(?:
-
[1-9]
\d
?
)
?
$
^(?:\d+|MK[A-Za-z0-9]+)(?:-[1-9]\d?)?$
/
gmi
g
i
m
s
u
y
flags
Test bench
Sample text
6 matches
mkotq4ear6
mkotq4ear6-2
MKOTQ4EAR6
MKOTQ4EAR6-99
MKOTQ4EAR6-1
12345678
123ABC123 MKOTQ4EAR6-100 MKOTQ4EAR6-01
mkotq4ear6 mkotq4ear6-2 MKOTQ4EAR6 MKOTQ4EAR6-99 MKOTQ4EAR6-1 12345678 123ABC123 MKOTQ4EAR6-100 MKOTQ4EAR6-01
Structure
Railroad diagram
Interactive
SVG
PNG
Copy
Embed
Live