- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find ISBN-10
ISBN\x20(?=.{13}$)\d{1,5}([- ])\d{1,7}\1\d{1,6}\1(\d|X)$
This RE validates the format of an ISBN number
ISBN 0 93028 923 4 | ISBN 1-56389-668-0 | ISBN 1-56389-016-X
123456789X | ISBN 9-87654321-2 | ISBN 123 456-789X
Author Rating: Not yet rated. Michael Ash
Your Rating
Bad Good

Enter New 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: ISSN
Name: Henk de Ridder
Date: 11/26/2011 1:26:34 PM
What would be the way to go for magazine ISSN's? For example 0000-0051, 1534-0481 or something ending on an X? The last figure is a checkdigit, but I know regexps don not calculate, so we'll just have to do the shape...

Title: ISBN-10
Name: Michael Ash
Date: 9/15/2006 3:19:15 PM
If you follow this link it explains how the various part of an ISBN can vary in length but in the end has 10 digits. The regex after finding the string ISBN (followed by a space) has 13 characters to the end of the string which is the length of the digit and separators, then finds the remaining parts of the ISBN in their allowed length range.

Title: ISBN-10
Name: habeeb
Date: 7/22/2006 1:03:45 AM
Hi, Can u explain the ISBN RE pattern in detail?

Title: Re: Modulus 10
Name: Michael Ash
Date: 2/28/2005 1:27:04 PM
ISBN uses a modulus 11 for it's check digit. See This regex doesn't validate if the check digit is good or not.

Title: Modulo 10
Name: zingmatter
Date: 2/28/2005 1:05:47 PM
The last digit is a modulo 14(? not sure) check digit.

Title: re:Doesn't limit digits properly
Name: Michael Ash
Date: 5/14/2004 12:17:40 PM
Please provide an example of this.

Title: Doesn't limit digits properly
Name: Tim
Date: 5/14/2004 11:50:31 AM
The RE does not properly limit the number of digits. You can end up with a 14 digit ISBN that will match with this pattern.

Title: Nice Pattern
Name: Darren Neimke
Date: 12/9/2003 6:03:21 AM
Nice job Michael! :-)

Copyright © 2001-2024, | ASP.NET Tutorials