ISBN Regex Pattern

Example:
Simplified: ^(?:ISBN)?[-0-9X]{10,17}$
Validate ISBN-10 or ISBN-13: ^(?:ISBN(?:-1[03])?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})[- 0-9X]{13}$|97[89][0-9]{10}$|(?=(?:[0-9]+[- ]){4})[- 0-9]{17}$)(?:97[89][- ]?)?[0-9]{1,5}[- ]?[0-9]+[- ]?[0-9]+[- ]?[0-9X]$
Try Regex Lab →

FAQs

Should I use regex for ISBN validation?

Regex validates format. For production, also verify the check digit with ISBN algorithm.