Validate International Securities Identification Number: Difference between revisions

Line 2,102:
 
=={{header|langur}}==
The luhn test is repeated here for simplicity (from Luhn_test_of_credit_card_numbers#langur).
 
<syntaxhighlight lang="langur">val .luhntest = ffn(.s) {
val .t = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
val .numbers = s2n .s
Line 2,118:
}
 
val .isintest = ffn(.s) {
.s -> re/^[A-Z][A-Z][0-9A-Z]{9}[0-9]$/ and
.luhntest(join s2n .s)
889

edits