View Single Post
Old 02-09-2021, 09:56 AM   #17
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,167
Karma: 60406498
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ownedbycats View Post
I was trying to make a second regex to account for ISBNs with spaces/dashes. Did I make a mistake with the regex or the search syntax here?

https://regex101.com/r/vJUZpu/1

Code:
identifiers:"=isbn:~\d{1}(-|\s)\d{3}(-|\s)\d{5}(-|\s)\d{1}"
(I also need to figure out how to account for the X check digit)
replace the last term with [0-9X]
FWIW \d{1} is redundant. \d is a single DIGIT

Also: Your pattern is way to tight for small presses
0-1234567-8-X is valid (check digit is incorrect )
1-2-3456789-0 is valid, and any 8 digit combination in between the language and check
theducks is offline   Reply With Quote