View Single Post
Old 10-06-2012, 02:29 PM   #252
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,166
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 myce View Post
The blank or dash before the number isn't relevant. The regexp will (should) start matching at the first digit.
No it should start at the first Matching pattern:
The pattern should attempt to match starting at the first digit.
\d+\-\d+\-\d+\-(\d|X)
is one pattern, the first digit pair followed by a space should not be included in the match because it violates this pattern (dash separator)

Now if they had used spaces every place, you are correct, that the pattern should have started with the 10 (because we don't know where the line ends, we can')t tell that there were more digits than the pattern could capture if it had not started with the wrong number group

Because of all the various ways of printing the ISBN, lots of post capture validating needs to be done (The FAX number managed to MOD11 validate (a fairly rare case) ).
theducks is offline   Reply With Quote