International Standard Book Number (ISBN) Regular Expression

Category: Strings | Views Total: 14 views

A Regular Expression to match and validate International Standard Book Number (ISBN). Supports both ISBN 10 and ISBN 13.

/^(?=(?:\D*\d){10}(?:(?:\D*\d){3})?$)[\d-]+$/

Matches:

  • 978-1-56619-909-4
  • 1257561035
  • 1248752418865

Non-matches:

  • 978-1-56619-909-4 2
  • isbn446877428ydh
  • 55 65465 4513574
Rate This Regex
Sending
User Review
0 (0 votes)

Leave a Reply