You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2020/11/03 22:48:18 UTC

[commons-validator] branch master updated: VALIDATOR-477 Add IBAN validator for LY – Libya

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git


The following commit(s) were added to refs/heads/master by this push:
     new cc57894  VALIDATOR-477 Add IBAN validator for LY – Libya
cc57894 is described below

commit cc578944b2fe9e88a631d7a6ecbb226968143401
Author: Sebb <se...@apache.org>
AuthorDate: Tue Nov 3 22:48:08 2020 +0000

    VALIDATOR-477 Add IBAN validator for LY – Libya
---
 src/changes/changes.xml                                               | 3 +++
 .../java/org/apache/commons/validator/routines/IBANValidator.java     | 4 ++++
 .../java/org/apache/commons/validator/routines/IBANValidatorTest.java | 1 +
 3 files changed, 8 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5b29e6a..67061da 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,9 @@ The <action> type attribute can be add,update,fix,remove.
 
   <body>
   <release version="1.8" date="20YY-MM-DD" description="">
+    <action issue="VALIDATOR-477" type="update" dev="sebb">
+    Add IBAN validator for LY – Libya
+    </action>
     <action type="update" dev="ggregory" due-to="Dependabot">
     Update actions/checkout from v2.3.1 to v2.3.2 #38.
     </action>
diff --git a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
index 5624fde..11ff4ff 100644
--- a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
@@ -93,6 +93,9 @@ public class IBANValidator {
      * The above is an old version (62, Jan 2016)
      * As at May 2020, the current IBAN standards are located at:
      * https://www.swift.com/standards/data-standards/iban
+     * The above page contains links for the PDF and TXT (CSV) versions of the registry
+     * Warning: these may not agree -- in the past there have been discrepancies.
+     * The TXT file can be used to determine changes which can be cross-checked in the PDF file.
      * [3] http://www.europeanpaymentscouncil.eu/documents/ECBS%20IBAN%20standard%20EBS204_V3.2.pdf
      */
     
@@ -143,6 +146,7 @@ public class IBANValidator {
             new Validator("LT", 20, "LT\\d{18}"                             ), // Lithuania
             new Validator("LU", 20, "LU\\d{5}[A-Z0-9]{13}"                  ), // Luxembourg
             new Validator("LV", 21, "LV\\d{2}[A-Z]{4}[A-Z0-9]{13}"          ), // Latvia
+            new Validator("LY", 25, "LY\\d{23}"                             ), // Libya
             new Validator("MC", 27, "MC\\d{12}[A-Z0-9]{11}\\d{2}"           ), // Monaco
             new Validator("MD", 24, "MD\\d{2}[A-Z0-9]{20}"                  ), // Moldova
             new Validator("ME", 22, "ME\\d{20}"                             ), // Montenegro
diff --git a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
index 68818ed..2388d54 100644
--- a/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
@@ -95,6 +95,7 @@ public class IBANValidatorTest {
             "LI21088100002324013AA",
             "LT121000011101001000",
             "LU280019400644750000",
+            "LY83002048000020100120361",
             "LV80BANK0000435195001",
             "MC5811222000010123456789030",
             "MD24AG000225100013104168",