Can someone give me a hand with an ISBN RegEx? I need to extract a valid
ISBN that's entered by a hand scanner, which means it might have leading or
trailing characters. This string works for an ISBN as long as it has no
trailing characters:

ISBN (?=.{13}$)\d{1,5}( |\-)\d{1,7}\1\d{1,6}\1(\d|X)$

I tried removing the "end of string" character:

ISBN (?=.{13}$)\d{1,5}( |\-)\d{1,7}\1\d{1,6}\1(\d|X)

The RegEx matches strings with leading characters, but not with trailing
characters. For example, ReFindNoCase() for the following string correctly
returns 3:

- ISBN 0-394-52836-0

But even though the following string contains a valid ISBN, ReFindNoCase()
returns 0:

ISBN 0-394-52836-0 ~I(J(

Thanks for any assistance.

Best,

Marc A. Garrett

[EMAIL PROTECTED]
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to