View Single Post
Old 10-07-2012, 07:07 AM   #253
myce
Member
myce began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Oct 2012
Device: Sony PRS-T1
Quote:
Originally Posted by theducks View Post
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)
That was what I tried to express by the "should" in parenthesis. First I wrote will cause I would have implemented the pattern with a starting digit. Then I saw from the logfile that it is currently implemented differently, cause the match started with the dash.

The pattern you suggested will only match if the ISBN contains exactly three dashes. I'd implement something along the lines of \d(\d| |-)+(\d|X) and then validating all substrings consisting of 10 and 13 digits.

But I fail to see why we are discussing about the best way to implement this. I could see a point in a discussion with the maintainer of the plugin. But that would be kiwidude. It's his decision how he writes his plugin. I just wanted to point out a case in which the current implementation fails.
myce is offline   Reply With Quote