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
User Review
( votes)Expression Flags
Flags | Description |
---|---|
i |
Ignore case sensitive. |
g |
Allows global search. |
m |
Allows multiline search. |