Created
July 18, 2012 07:51
-
-
Save hpmewes/3134906 to your computer and use it in GitHub Desktop.
Revisions
-
SCS revised this gist
Jul 18, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ /** * Check for Germany IBAN */ var regexIBANDE = '([A-Z]{2})([0-9]{2})([0-9]{8})([0-9]{10})'; var matchIBANDE = $('#someid').val().match(regexIBANDE); -
SCS created this gist
Jul 18, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ var regexIBANDE = '([A-Z]{2})([0-9]{2})([0-9]{8})([0-9]{10})'; var matchIBANDE = $('#someid').val().match(regexIBANDE); console.log('match: iban '+matchIBANDE); // iban correct if(matchIBANDE != null) { var IBAN = matchIBANDE[0]; var bankCode = matchIBANDE[3]; var regexBankAccountNr = '([0]*)([0-9]*)' var bankAccountNr = matchIBANDE[4]; console.log('match: bank '+bankAccountNr.match(regexBankAccountNr)); bankAccountNr = bankAccountNr.match(regexBankAccountNr); // set bank data $('#bank_account_bank_account_nr').val(bankAccountNr[2]); $('#bank_account_bank_account_bank_code').val(bankCode); }