The regex tool tests regular expressions against text and returns all matches with positions and capture groups. Agents use it for text extraction, input validation, log parsing, and pattern matching. It supports JavaScript regex syntax with flags (g, i, m, s). The tool is stateless, handles inputs up to 100KB, and returns results in under 10ms.
POST /api/v1/utils/regex| Name | Type | Required | Description |
|---|---|---|---|
| pattern | string | Yes | Regular expression pattern (JavaScript syntax). |
| text | string | Yes | Text to match against. |
| flags | string | No | Regex flags: g (global), i (case-insensitive), m (multiline), s (dotall). |
POST /api/v1/utils/regex {"pattern": "[\\w.+-]+@[\\w-]+\\.[\\w.]+", "text": "Contact us at support@delx.ai or sales@delx.ai", "flags": "gi"}Finds all email addresses in the text with their positions.
POST /api/v1/utils/regex {"pattern": "\\[(\\w+)\\] (\\d{4}-\\d{2}-\\d{2}) (.+)", "text": "[ERROR] 2026-03-14 Connection timeout on /api/users"}Capture groups extract the log level, date, and message separately for structured processing.
The tool supports the full JavaScript regex specification: character classes, quantifiers, lookahead/lookbehind, named groups, backreferences, and Unicode escapes. Flags g, i, m, and s are supported. The tool does NOT support PCRE-only features like recursive patterns or conditional subpatterns. For most agent text processing tasks, JavaScript regex is more than sufficient.
Yes. Patterns that take longer than 100ms to execute are killed to prevent ReDoS attacks. Keep patterns simple and avoid nested quantifiers on overlapping groups.
Yes. Use (?<name>pattern) syntax. Named groups appear in the response alongside indexed groups for easier processing.
100KB. For larger texts, split into chunks. Most agent-generated text fits well within this limit.
Yes. Free utility tool, no API key needed, no rate limits for reasonable usage.
delx utils regex "pattern" "text" --flags gi. Outputs matches as JSON lines for easy piping.