Reference
Template syntax
A template is the SMS text with every changing part replaced by a
{placeholder}. It compiles to an anchored, case-insensitive regex with one named group per placeholder.Template
Sent currency.amount from Kotak Bank AC Xlast_four to merchantName on date.UPI Ref upi_ref.
Matches
Sent Rs.250.00 from Kotak Bank AC X3333 to chai.point@okaxis on 14-10-25.UPI Ref 2222222222. Not you, https://kotak.com/KBANKT/Fraud
Placeholders
| Placeholder | Meaning | Pattern |
|---|---|---|
| amount | Transaction amount, Indian or western digit grouping | [\d,]+(?:\.\d{1,2})? |
| currency | Rs / INR / USD … (currency2, currency3 for a second mention) | [A-Z]{2,4} |
| last_four | Last four digits of account or card | \d{4} |
| acct_tail | Account tail when the bank shows fewer than four digits | lazy wildcard |
| masked | Mask prefix before the digits (XX, ****, 20XXXXX) | lazy wildcard |
| date / time | Transaction date and time in whatever format the bank uses | (?:\d{2}-[A-Z]{3}-\d{2,4}|\d{2}[A-Z]{3}\d{4}|[\dA-Z\-/ :T]{4,32}) |
| merchantName | Payee, payer, VPA or merchant descriptor | lazy wildcard |
| upi_ref | UPI / IMPS / RRN reference number | [A-Za-z0-9\-]{4,32} |
| ref | Other reference: UTR, ACH id, transaction number | lazy wildcard |
| balance / limit | Available balance or available credit limit | lazy wildcard |
| skip | Text that varies but is not extracted (skip2 for a second one) | lazy wildcard |
Whitespace-tolerant
Every placeholder is wrapped in \s*, so an extra or missing space around a value still matches.
Lazy by default
Untyped placeholders match as little as possible; the last one in a template is greedy so it can run to the end.
Prefix match
Regexes are anchored at the start only. Trailing boilerplate (helpline numbers, links) can be left out of the template.
Known limitation
The{date} pattern accepts letters and spaces so it can cover formats like 15-MAR-2025 at 10:00 AM. When a date directly follows a merchant name with no fixed word between them, it can swallow part of the name. Yes Bank's @UPI_ card format is affected.