Validationflags: g
ISBN-13
Match 13-digit ISBNs starting with 978 or 979, with optional hyphens or spaces.
Try it in RegexProPattern
regexJavaScript
/\b97[89][\- ]?(?:\d[\- ]?){9}\d\b/gRaw source: \b97[89][\- ]?(?:\d[\- ]?){9}\d\b
How it works
The 978 or 979 GS1 prefix anchors the match, followed by nine digits (with optional separators) and a final check digit.
Examples
Input
978-0-306-40615-7Matches
978-0-306-40615-7
Input
9780306406157Matches
9780306406157
Common use cases
- Modern book catalog validation
- Retail inventory systems
- Publisher metadata ingestion
- ISBN format conversion pipelines