[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: count matches in string, not region?

From: Emanuel Berg
Subject: Re: count matches in string, not region?
Date: Wed, 26 Feb 2020 22:22:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Tassilo Horn wrote:

> Another way would be
>   (string-match-p "^[[:digit:]]\\{13\\}$" isbn)
> which returns non-nil iff isbn is a string of
> exactly thirteen digits.

Okay ... another way of doing ...?

Here is an example of an ISBN-10:


and here is an ISBN-13:


the check digit is the last one (X meaning 10,
and 0, respectively), so actually one only
needs 9 digits in the first case and 12 in
the second, to compute the check digit.

The groupings (...-...-...-...) do mean things
but not with respect to how the check digit is
computed, so one can just drop dashes and all
chars that aren't digits.

More examples in the old file,

Thanks for the mail tho, I really want to close
the BOOK on this, so fire away all suggestion
you have :)

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]