
10 Apr
2005
10 Apr
'05
9:40 a.m.
we need to validate ISBN. With another REGEX-implementation we uses (?=.{13})\d{1,5}( |\-)\d{1,7}\1\d{1,6}\1(\d|X). But this seem not to work. Only the shorter version "\d{1,5}( |\\-)?\\d{1,7}\\1\\d{1,6}\\1(\d|X)" works, but how to check the 13 digits?
It certainly should work, but can you: 1) Check that if you are embedding the regex in the program as a string, that you have "double escaped" any escape characters that should be seen by the regex engine (remember that the C++ compiler swallows the first one). 2) Can you provide a short test case of something you think you should work but doesn't. Thanks, John.