I want to create a control on the iban with the following characteristics :
- minimum 14 characters
- maximum 34 characters
- the first 2 characters are always two letters (country identifier)
- the 3rd and 4th characters always two digits (control keys (from 02 to 98)
I am trying to develop a simple REGEX in Java with pattern like that:
@Pattern(
regexp = "[a-zA-Z]{2}([2-9]|[1-8][0-9]|9[0-8]){2}[a-zA-Z0-9]{4}[0-9]{6}([a-zA-Z0-9]?){0,20}",
message = "Le format de l'iban est invalide"
)
The problem for the 3rd and 4th character is that the system does not accept these conditions (10,20,30,40,50,60,70,80,90) although these numbers are included in the interval [ 02-98]