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 2024/12/19 12:43:18 UTC

(commons-validator) branch master updated: Document upper case only

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 441ace64 Document upper case only
441ace64 is described below

commit 441ace6421f804ad412e4e4e1eb39c6296b5ca19
Author: Sebb <se...@apache.org>
AuthorDate: Thu Dec 19 12:43:12 2024 +0000

    Document upper case only
    
    [skip ci]
---
 .../org/apache/commons/validator/routines/IBANValidator.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

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 025d95d2..04df262b 100644
--- a/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
+++ b/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
@@ -139,6 +139,13 @@ public class IBANValidator {
 
     private static final int SHORT_CODE_LEN = 2;
 
+    /*
+     * Note: the IBAN PDF registry file implies that IBANs can contain lower-case letters.
+     * However, several other documents state that IBANs must be upper-case only.
+     * [See the comment block following this array.]
+     * 
+     * In the Regexes below, only upper-case is used.
+     */
     private static final Validator[] DEFAULT_VALIDATORS = {                   //
             new Validator("AD", 24, "AD\\d{10}[A-Z0-9]{12}"),                 // Andorra
             new Validator("AE", 23, "AE\\d{21}"),                             // United Arab Emirates (The)
@@ -163,7 +170,7 @@ public class IBANValidator {
             new Validator("EE", 20, "EE\\d{18}"),                             // Estonia
             new Validator("EG", 29, "EG\\d{27}"),                             // Egypt
             new Validator("ES", 24, "ES\\d{22}"),                             // Spain
-            new Validator("FI", 18, "\\d{16}", "AX"),                         // Finland
+            new Validator("FI", 18, "\\d{16}", "AX"),                // Finland
             new Validator("FK", 18, "FK\\d{2}[A-Z]{2}\\d{12}"),               // Falkland Islands, since Jul-23
             new Validator("FO", 18, "FO\\d{16}"),                             // Faroe Islands
             new Validator("FR", 27, "\\d{12}[A-Z0-9]{11}\\d{2}", "GF", "GP", "MQ", "RE", "PF", "TF", "YT", "NC", "BL", "MF", "PM", "WF"), // France