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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find National Drug Code
Expression
\d{4}-\d{4}-\d{2}|\d{5}-\d{3}-\d{2}|\d{5}-\d{4}-\d{1}|\d{5}-\*\d{3}-\d{2}
Description
http://en.wikipedia.org/wiki/National_Drug_Code
Matches
1234-5678-90 | 12345-678-90 | 12345-6789-0 | 49981-*007-01
Non-Matches
1234-56-8-90 | 123-45678-90 | 1-345-6789-0
Author Rating: The rating for this expression. Tom Struzik
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: to the point
Name: Dave Vogt
Date: 7/30/2021 4:22:29 AM
Comment:
I was trying to dream up some fancy way of capturing each of the four styles in a single expression, but as usual it's simpler to just OR everything together. Kudos!


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