Test, validate and match regular expressions
This regular expression validates Indian PAN (Permanent Account Number) and TAN (Tax Deduction and Collection Account Number) formats. The first alternative matches the PAN format of 5 letters, 4 digits, and 1 letter, while the second matches a TAN format of 4 letters, 5 digits, and an optional letter. It is typically used in financial or tax-related web forms to ensure correct identification number formatting.