IFSC Code description:
E.g.
SBIN1234567
Here is what I tried but its not working.
("^[^\s]{4}\d{7}$")
What about /^[A-Za-z]{4}\d{7}$/
Check here
Edit
As per definitions of IFSC code posted here in other answers, it is first 4 characters as digit and remaining 7 characters as alphanumeric , regex would be
^[A-Za-z]{4}[a-zA-Z0-9]{7}$
According to Indian Financial System Code on wikipedia
IFSC Code Format:
1] Exact length should be 11
2] First 4 alphabets
3] Fifth character is 0 (zero)
4] Last six characters (usually numeric, but can be alphabetic)
Try this:-
^[A-Za-z]{4}0[A-Z0-9a-z]{6}$
As per new rules, RBI changed it's guideline for IFSC Code,
New Format for IFSC Code : Eg. ABCD0123456
The IFSC is an 11-character code with the first four alphabetic characters representing the bank name, and the last six characters (usually numeric, but can be alphabetic) representing the branch. The fifth character is 0 (zero) and reserved for future use. Bank IFS Code is used by the NEFT & RTGS systems to route the messages to the destination banks/branches.
For Code Validation : "^[A-Z]{4}[0][A-Z0-9]{6}$"
For Java:
public static boolean isIfscCodeValid(String IFSCCode)
{
String regExp = "^[A-Z]{4}[0][A-Z0-9]{6}$";
boolean isvalid = false;
if (IFSCCode.length() > 0) {
isvalid = IFSCCode.matches(regExp);
}
return isvalid;
}
where isIfscCodevalid() is common static method, which accepts string as parameter(String email) input from User and matches with regExp for IFSC Code Validation and returns the value as true or false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With