This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// really, really, really simple - only regex based - bic check | |
// /(?i).../ is the java equivalent to /.../i | |
boolean bicCheck(String bic) { | |
bic ==~ /(?i)[a-z]{6}[a-z2-9][a-np-z0-9]([a-wyz0-9][a-z0-9]{2})?(x{3})?/ ? true : false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// really, really, really simple IBAN check and helper methods | |
boolean ibanCheck(String iban) { | |
String iban2 = iban2DB(iban) | |
String bban = iban2.substring(4) | |
String lkzPrf = iban2.substring(0,4) | |
String ibanDec = "" | |
(bban + lkzPrf).each { c -> | |
if (c >= "0" && c <= "9") | |
ibanDec += c |