Regular expression for IFSC code(first four alphabet and then 7 digit.)

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 email) 
{
    String regExp = "^[A-Z]{4}[0][A-Z0-9]{6}$";
    boolean isvalid = false;

    if (email.length() > 0) {
        isvalid = email.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.