Text Pattern Match
Match text against a pattern and extract named values from it. Useful for parsing dates, addresses, URLs, and structured text. Uses Go RE2 regex syntax.
Built-in action Built In
Match text against a pattern and extract named values from it. Useful for parsing dates, addresses, URLs, and structured text. Uses Go RE2 regex syntax.
At a Glance
| Field | Value |
|---|---|
| Action ID | regex |
| Category | Built In |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | utility, regex, parsing, text, extraction, data-processing |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The text to match against the regex pattern. Supports workflow variables like {{node.result.field}}. |
pattern | string | Yes | Regular expression pattern (Go RE2 syntax). Use (?P<name>...) for named capture groups. Max 1024 characters. |
global | boolean | No | If true, find all matches instead of just the first. Default: false. |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
matched | boolean | Yes | Whether the pattern matched the text |
matches | object | No | Captured groups. Single mode: object with group names as keys. Global mode: array of such objects. Each object includes key '0' for the full match. Access named groups via {{nodeId.result.matches.groupName}}. |
Examples
json{ "type": "regex", "payload": { "text": "2024-01-15T10:30:00Z", "pattern": "(?P<year>\\d{4})-(?P<month>\\d{2})-(?P<day>\\d{2})" }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/regex/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "text": "2024-01-15T10:30:00Z", "pattern": "(?P<year>\\d{4})-(?P<month>\\d{2})-(?P<day>\\d{2})" }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
