Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Looking for the perfect ISBN Regex

I'm trying to get a regex that validates ISBN 10 and ISBN 13

"978-1-56619-909-4 2" => false
"978-1-56619-909-4" => true
"1-56619-909-3 " => false
"1-56619-909-3" => true
"isbn446877428ydh" => false
"55 65465 4513574" => false
"1257561035" => true
"1248752418865" => true
"978-8445073728" => true
"841671603X" => true
"1-56619-909-X" => true
"12-48752-41-8-8-6-5" => false

This regex I found is almost perfect ^(?=(?:\D*\d){10}(?:(?:\D*\d){3})?$)[\d-]+$ but... "841671603X" will return false and "12-48752-41-8-8-6-5" will return true.

  • For ISBN10 I want to be true 10 digits in only these formats:
"1-56619-909-3"
"1257561035"
"1-56619-909-X"
"841671603X"
  • For ISBN13 I want to be true 13 digits in only these formats:
"978-1-56619-909-4"
"978-8445073728"
"1248752418865"

If you could help me, I'd appreciate it a lot.

Thank you in advance.

Best Regards.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!