aboutsummaryrefslogtreecommitdiff
path: root/challenge-135/abigail/awk
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2021-10-19 20:13:33 +0200
committerAbigail <abigail@abigail.be>2021-10-19 20:25:58 +0200
commit210e271ec3014cf6f08e9ce5d3e2ffbd92a61619 (patch)
treec1cc76b4f9b6e317f74e96487de3cb9054e86acd /challenge-135/abigail/awk
parentec0548d9d1f8f277a0cd78d5a626c4efdd42f3ef (diff)
downloadperlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.tar.gz
perlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.tar.bz2
perlweeklychallenge-club-210e271ec3014cf6f08e9ce5d3e2ffbd92a61619.zip
Last character of a SEDOL must be a number.
Without this check, it could validate the SEDOL which uses a letter as a check digit. For instance, if the check digit is a '1', using 'B' would validate as well.
Diffstat (limited to 'challenge-135/abigail/awk')
-rw-r--r--challenge-135/abigail/awk/ch-2.awk1
1 files changed, 1 insertions, 0 deletions
diff --git a/challenge-135/abigail/awk/ch-2.awk b/challenge-135/abigail/awk/ch-2.awk
index 021224dfe0..8da795ccf7 100644
--- a/challenge-135/abigail/awk/ch-2.awk
+++ b/challenge-135/abigail/awk/ch-2.awk
@@ -24,6 +24,7 @@ BEGIN {
#
/[^0-9BCDFGHJKLMNPQRSTVWXYZ]/ {print 0; next}
length ($0) != 7 {print 0; next}
+/[^0-9]$/ {print 0; next}
#
# Do the check sum