Regex Transaction Parser
Build regex patterns to categorize bank transactions.
Like this tool? Help keep portfolios.tools free forever.
How It Works
Write a regex pattern with capture groups and paste sample bank transaction descriptions, one per line. The tool tests each line against your pattern. Export CSV from your bank and paste the description column. Strip amount and date columns first. The explanation panel breaks down each regex token so you can learn as you build. Personal finance dashboards often need 30 to 50 patterns covering groceries, dining, transport, and subscriptions. Paste sample brokerage CSV lines and define capture groups for date, symbol, quantity, and amount fields. Test pattern on header row plus first data row before running against full ten thousand line export. Paste sample brokerage CSV lines and define capture groups for date, symbol, quantity, and amount fields. Test pattern on header row plus first data row before running against full ten thousand line export.
Review match results, capture groups, coverage percentage, and category groupings. The explanation panel helps you understand regex components. Iterate patterns until unmatched count is small. Copy working patterns into your personal finance automation scripts or spreadsheet IMPORT formulas for ongoing categorization. Split complex bank formats into merchant and category capture groups for easier maintenance when statements change format. Budget apps like Actual Budget and Firefly III accept import rules similar to patterns tested here. Test regex against twenty lines before importing thousand row files: one bad pattern mislabels entire history. Capture group tester highlights which lines fail match before importing full history. European brokers often use semicolon delimiter: adjust pattern before US comma assumptions. Test regex against twenty lines before importing thousand row files: one bad pattern mislabels entire history. Capture group tester highlights which lines fail match before importing full history. European brokers often use semicolon delimiter: adjust pattern before US comma assumptions.
twenty lines before importing thousand row files: one bad pattern mislabels entire history. Capture group tester highlights which lines fail match before importing full history. European brokers often use semicolon delimiter: adjust pattern before US comma assumptions. Test regex against twenty lines before importing thousand row files: one bad pattern mislabels entire history. Capture group tester highlights which lines fail match before importing full history. European brokers often use semicolon delimiter: adjust pattern before US comma assumptions.
Use Regex Transaction Parser whenever inputs change: after market moves, new contributions, or revised personal assumptions. Bookmark the page for quick reruns without installing software.
Step by step
- Write your regex pattern with capture groups
- Paste sample transaction descriptions
- Review matches, coverage, and category map
Worked example
Write a regex pattern with capture groups and paste sample bank transaction descriptions, one per line. Enter the sample inputs described in How it works to reproduce the scenario step by step.
Adjust one input at a time to see sensitivity. Regex Transaction Parser updates instantly so you can stress test optimistic and conservative assumptions before acting.
When to use this calculator
Reach for Regex Transaction Parser when build regex patterns to categorize bank transactions.. It suits quick what if analysis before trades, allocation changes, or plan updates.
Pair with related tools when the decision spans taxes, liquidity, or multi year projections beyond what one formula captures.
Common mistakes
Copying outputs without checking input units or stale market prices is a frequent error with Regex Transaction Parser. Confirm tickers, percentages, and dates before acting.
Running a single baseline scenario ignores tail risks. Stress test with conservative inputs and compare against related tools listed below when the decision is material.
The Formula
Regex tested via new RegExp(pattern, 'i'). Matches and captures groups via exec(). Coverage = Matched Count / Total Samples × 100. Category map groups descriptions by capture group index.
Case insensitive matching. Explanation panel decodes common regex tokens for learning. Does not support lookbehind on all browsers. Escape special characters in merchant names like L\&L BAR. Production pipelines should log unmatched transactions weekly for pattern maintenance. Word boundaries \b help avoid partial matches inside longer merchant strings. Parser runs in browser only: never upload statements with account numbers to external servers. ReDoS risk low for simple patterns but avoid catastrophic nested quantifiers on huge files. ISO date YYYY MM DD output format sorts correctly in downstream ledger imports without reparse. Never upload statements with account numbers to external servers: parser runs locally. Parser runs in browser only: never upload statements with account numbers to external servers. ReDoS risk low for simple patterns but avoid catastrophic nested quantifiers on huge files. ISO date YYYY MM DD output format sorts correctly in downstream ledger imports without reparse. Never upload statements with account numbers to external servers: parser runs locally.
Limitations and assumptions
Case insensitive matching. Explanation panel decodes common regex tokens for learning. Does not support lookbehind on all browsers. Escape special characters in merchant names like L\&L BAR. Production pipelines should log unmatched transactions weekly for pattern maintenance. Word boundaries \b help avoid partial matches inside longer merchant strings. Parser runs in browser only: never upload statements with account numbers to external servers. ReDoS risk low for simple patterns but avoid catastrophic nested quantifiers on huge files. ISO date YYYY MM DD output format sorts correctly in downstream ledger imports without reparse. Never upload statements with account numbers to external servers: parser runs locally. Parser runs in browser only: never upload statements with account numbers to external servers. ReDoS risk low for simple patterns but avoid catastrophic nested quantifiers on huge files. ISO date YYYY MM DD output format sorts correctly in downstream ledger imports without reparse. Never upload statements with account numbers to external servers: parser runs locally. Regex Transaction Parser does not replace personalized advice. Fees, slippage, account specific rules, and behavioral constraints may change real world outcomes.
Key terms
- How does the regex parser categorize transactions
- Enter a regex pattern and sample transaction descriptions.
- How do capture groups work
- Capture groups are marked by parentheses ().
- Model assumption
- Coverage = (Matched / Total Samples) × 100.
Compare alternatives
SQL to TypeScript Generator helps type transaction database schemas for finance apps. Use those calculators when regex transaction parser alone does not capture the full decision.
Internal links on portfolios.tools help you chain calculators: run Regex Transaction Parser first, then validate edge cases with a specialized tool from the related section below.
FAQ
How does the regex parser categorize transactions?
Enter a regex pattern and sample transaction descriptions. The tool tests each description against the pattern, extracts capture groups, and categorizes each match by the specified group number. The regex engine uses case insensitive matching by default to catch variations like amazon, Amazon, or AMAZON as the same merchant. Test with 20 to 50 real bank export lines for reliable coverage estimates. Chase, Bank of America, and Wells Fargo exports use different description formats requiring separate pattern libraries. Credit card versus checking descriptions for the same merchant often need distinct patterns. Named groups map to JSON keys in output: use (?<date>...) syntax for readable transformation templates. Multiline CSV with embedded commas inside quotes requires regex that respects quoted field boundaries. Named capture groups map to JSON keys for date symbol quantity and amount fields. Named groups map to JSON keys in output: use (?<date>...) syntax for readable transformation templates. Multiline CSV with embedded commas inside quotes requires regex that respects quoted field boundaries. Named capture groups map to JSON keys for date symbol quantity and amount fields.
How do capture groups work?
Capture groups are marked by parentheses (). Group 1 is typically the category name. Adjust categoryGroup parameter to use a different capture group for categorization. Example pattern (AMAZON|WALMART).*?(Grocery|Shopping) assigns category from group 2. Non capturing groups (?:...) do not count toward group indices. Named groups are not supported; use numeric group index only for category assignment. Test capture group output on five samples before deploying to production categorization scripts. European date formats need explicit day month year pattern: US default MM/DD/YYYY fails on many EU exports. European date formats need explicit day month year pattern: US default MM/DD/YYYY fails on many EU exports.
What does coverage percentage mean?
Coverage = (Matched / Total Samples) × 100. This shows what percentage of your transaction descriptions the regex pattern successfully matches. Aim for 90%+ coverage before importing patterns into budgeting apps like YNAB or Monarch. Unmatched lines reveal merchants needing additional patterns or broader alternation groups. Track coverage monthly as banks add new merchant descriptor formats to statement lines. Multi currency lines require separate regex branch or normalized amount group after currency symbol strip. Split lines on comma versus semicolon based on broker locale export settings. Multi currency lines require separate regex branch or normalized amount group after currency symbol strip. Split lines on comma versus semicolon based on broker locale export settings.
How are categories assigned?
If a sample matches, it is assigned to the category from the specified capture group. If no match, it is marked as Unmatched. The category map groups matched descriptions by category. Review unmatched samples first: they often share prefixes like POS DEBIT or ACH that you can optionally strip in preprocessing. Duplicate merchant names with different suffixes may need separate alternation branches in one pattern.
How do I build good transaction regex?
Start with known patterns like AMAZON or WALMART for merchant matching. Test against real descriptions and iterate until coverage is high. The explanation panel decodes regex tokens. Use alternation (MERCHANT1|MERCHANT2) for category groups. Anchor patterns with ^ when descriptions always start with the merchant name for faster matching. Build a library of patterns per category and combine with logical OR for production import pipelines. Plaid and MX aggregator formats use different description strings than raw bank CSV exports. Save working patterns in localStorage per broker: Schwab, IBKR, and Degiro use different column orders. Export parsed JSON to compare against broker official gain loss report for reconciliation audit. Share working regex patterns with tax preparer when importing multi year broker history into gain loss software. Save working patterns in localStorage per broker: Schwab, IBKR, and Degiro use different column orders. Export parsed JSON to compare against broker official gain loss report for reconciliation audit.
Can I use Regex Transaction Parser on a phone or tablet?
Yes. Regex Transaction Parser runs entirely in your mobile browser with the same formulas as desktop. Optional localStorage may remember inputs on your device when enabled in browser settings.
Where is my data stored when I use Regex Transaction Parser?
Nowhere on our servers. Calculations execute locally in your browser. Optional localStorage saves form fields on your device only and never transmits portfolio numbers over the network.
Should I rely on Regex Transaction Parser for tax or legal decisions?
No. Regex Transaction Parser provides educational math only. Tax law, account rules, and personal circumstances vary. Consult a qualified tax or legal professional before transactions with material consequences.
Related Tools
SQL to TypeScript Generator helps type transaction database schemas for finance apps. API Mock Generator creates sample payloads for testing categorization webhooks. Cron Market Scheduler supports nightly jobs that import and categorize new bank CSV exports. Latte Factor Calculator complements transaction categorization for discretionary spending analysis. Sinking Fund Planner uses category totals from parsed transactions to allocate monthly savings goals. CSV to Financial JSON Converter offers preset broker maps when regex feels heavy for standard exports. CSV to Financial JSON Converter offers preset broker maps when regex feels heavy for standard exports.