eightHundreds
4/12/2017 - 5:19 AM

ISBN.md

match ISBN-10 or ISBN-13

example:

  • 978-7-01-013156-6
  • 7-5073-0924-X

Python,Js

(?:(?=[-0-9]{13,}$)97[89][-\]?[0-9]{1,5}[-\]?[0-9]+[-\]?[0-9]+[-\]?[0-9])|(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})[- 0-9X]{13}$)[0-9]{1,5}[- ]?[0-9]+[- ]?[0-9]+[- ]?[0-9X]