Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
CAS Number parser
Open Workspace
PCRE2 (PHP)
Match
Created 2026-06-30 06:38
1
Regular Expression
/
(?<seg_a>
\d
{2,7}
)
[
–-
]
(?<seg_b>
\d
{2}
)
[
–-
]
(?<seg_checksum>
\d
)
/
gm
Description
Parses valid CAS numbers
Submitted by
Justin Hyland