Validationflags: g

ISBN-13

Match 13-digit ISBNs starting with 978 or 979, with optional hyphens or spaces.

Try it in RegexPro

Pattern

regexJavaScript
/\b97[89][\- ]?(?:\d[\- ]?){9}\d\b/g

Raw 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-7

Matches

  • 978-0-306-40615-7

Input

9780306406157

Matches

  • 9780306406157

Common use cases

  • Modern book catalog validation
  • Retail inventory systems
  • Publisher metadata ingestion
  • ISBN format conversion pipelines