RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find CAS Number
Expression
\b[1-9]{1}[0-9]{1,5}-\d{2}-\d\b
Description
This is a more robust regex for matching Chemical Abstract Service (CAS) Numbers. This distinguishes between CAS numbers and other identifiers (e.g. EC number).
Matches
50-00-0
Non-Matches
200-001-8
Author Rating: The rating for this expression. Jarlath
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Only matches 6 digits in first section
Name: Scott
Date: 5/31/2018 1:43:28 PM
Comment:
CAS numbers now allow 10 total digits, so the updated RegEx is \b[1-9]{1}[0-9]{1,6}-\d{2}-\d\b


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials