Regex Pattern Library
A collection of pre-built regex patterns for common data extraction in Power Automate Desktop. Each pattern is a standalone copy-paste segment using Text.ParseText.RegexParse or Text.Replace (regex mode).
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Problem this solves
Regex syntax is the most-asked PAD question on forums. Users don't know regex and need copy-paste patterns.
1Extract Email Addresses
Extracts standard email addresses (user@domain.tld) from a text variable. Returns all matches into a DataTable.
Variables: varInputText (input string to scan), varCurrentMessage (logging message), varEmailMatches (output DataTable of matched emails)
2Extract US Phone Numbers
Matches common US phone formats including parenthesized area codes, dashes, dots, and optional +1 country prefix.
Variables: varInputText (input string), varCurrentMessage (logging), varPhoneMatches (output DataTable of matched phone numbers)
3Extract Dates (Multiple Formats)
Three separate parse calls covering MM/DD/YYYY, ISO 8601 (YYYY-MM-DD), and long-form (January 15, 2025). Run all three against the same input to capture mixed date formats.
Variables: varInputText (input string), varCurrentMessage (logging), varDateMDY (MM/DD/YYYY matches), varDateISO (ISO date matches), varDateLong (long-form date matches)
4Extract US Currency Amounts
Matches dollar amounts with optional comma-separated thousands and two-digit cents. Covers $0.99 through $1,234,567.89.
Variables: varInputText (input string), varCurrentMessage (logging), varCurrencyMatches (output DataTable of matched amounts)
5Extract URLs
Matches http and https URLs including paths, query strings, and fragment identifiers.
Variables: varInputText (input string), varCurrentMessage (logging), varUrlMatches (output DataTable of matched URLs)
6Extract Invoice / Document Numbers
Two patterns: one for invoice-style prefixes (INV, INVOICE) and one for generic document numbers (PO, SO, WO, RFQ, QUO). Case-insensitive.
Variables: varInputText (input string), varCurrentMessage (logging), varInvoiceMatches (invoice number matches), varDocNumberMatches (document number matches)
7Extract US ZIP Codes
Matches 5-digit ZIP and ZIP+4 formats. Word boundaries prevent matching 5-digit substrings inside longer numbers.
Variables: varInputText (input string), varCurrentMessage (logging), varZipMatches (output DataTable of matched ZIP codes)
8Bonus — Strip Non-Numeric Characters (Text.Replace regex mode)
Uses Text.Replace with IsRegEx: True to remove all non-digit characters from a string. Useful for normalizing phone numbers or IDs before comparison. This pattern uses verified production syntax.
Variables: varInputText (input string), varCurrentMessage (logging), varNumericOnly (output cleaned string)
Variable Reference Summary
| Variable | Type | Used In | Purpose |
| `varInputText` | Text | All patterns | The source string to scan |
| `varCurrentMessage` | Text | All patterns | Logging message for Subflow_Logging |
| `varEmailMatches` | DataTable | Pattern 1 | Matched email addresses |
| `varPhoneMatches` | DataTable | Pattern 2 | Matched US phone numbers |
| `varDateMDY` | DataTable | Pattern 3 | Matched MM/DD/YYYY dates |
| `varDateISO` | DataTable | Pattern 3 | Matched YYYY-MM-DD dates |
| `varDateLong` | DataTable | Pattern 3 | Matched long-form dates |
| `varCurrencyMatches` | DataTable | Pattern 4 | Matched USD amounts |
| `varUrlMatches` | DataTable | Pattern 5 | Matched URLs |
| `varInvoiceMatches` | DataTable | Pattern 6 | Matched invoice numbers |
| `varDocNumberMatches` | DataTable | Pattern 6 | Matched document numbers |
| `varZipMatches` | DataTable | Pattern 7 | Matched ZIP codes |
| `varNumericOnly` | Text | Pattern 8 | Cleaned digits-only string |
Notes
- Patterns 1–7 use
Text.ParseText.RegexParsewhich requires$fx'...'wrapping on all parameters. Variable input uses%var%interpolation. - Pattern 8 uses
Text.ReplacewithIsRegEx: Truewhich accepts bare variable references and$'...'literals. - All DataTable outputs can be iterated with
FOREACH varMatch IN varMatches.