> ## Documentation Index
> Fetch the complete documentation index at: https://docs.condotta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Regex Tools

> Match, extract, replace, split, and validate using regular expressions.

The Regex Tools connector provides regular expression operations for pattern matching, extraction, and text manipulation.

> [!NOTE]
>
> No connection required; this utility connector works out of the box.

## Tools

> [accordion] match: Find all matches
>
> **text** `string` *required*
>
> Text to search.
>
> **pattern** `string` *required*
>
> Regular expression pattern.
>
> **flags** `string` (default: g)
>
> Regex flags (e.g., `g`, `i`, `m`).
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "Contact us at support@example.com or sales@example.com",
>   "pattern": "[\\w.+-]+@[\\w-]+\\.[\\w.]+",
>   "flags": "g"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "count": 2,
>   "matches": [
>     "support@example.com",
>     "sales@example.com"
>   ]
> }
> ```

> [accordion] extract: Extract capture groups
>
> **text** `string` *required*
>
> Text to search.
>
> **pattern** `string` *required*
>
> Pattern with capture groups.
>
> **flags** `string` (default: g)
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "Order #1234 placed on 2026-04-02, Order #5678 placed on 2026-04-03",
>   "pattern": "Order #(\\d+) placed on (\\d{4}-\\d{2}-\\d{2})",
>   "flags": "g"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "matches": [
>     {
>       "fullMatch": "Order #1234 placed on 2026-04-02",
>       "groups": ["1234", "2026-04-02"],
>       "index": 0
>     },
>     {
>       "fullMatch": "Order #5678 placed on 2026-04-03",
>       "groups": ["5678", "2026-04-03"],
>       "index": 34
>     }
>   ],
>   "count": 2
> }
> ```

> [accordion] replace: Replace by regex
>
> **text** `string` *required*
>
> Source text.
>
> **pattern** `string` *required*
>
> Regex pattern.
>
> **replacement** `string` *required*
>
> Replacement string. Use `$1`, `$2` for capture groups, `$&` for full match.
>
> **flags** `string` (default: g)
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "2026-04-02",
>   "pattern": "(\\d{4})-(\\d{2})-(\\d{2})",
>   "replacement": "$2/$3/$1"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": "04/02/2026", "replacements": 1 }
> ```

> [accordion] split: Split by regex
>
> **text** `string` *required*
>
> Text to split.
>
> **pattern** `string` *required*
>
> Regex pattern.
>
> **limit** `number`
>
> Maximum number of splits.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "apple;; banana, cherry  orange",
>   "pattern": "[;,\\s]+"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "parts": ["apple", "banana", "cherry", "orange"],
>   "count": 4
> }
> ```

> [accordion] test: Test if pattern matches
>
> Returns `true` or `false`.
>
> **text** `string` *required*
>
> Text to test.
>
> **pattern** `string` *required*
>
> Regex pattern.
>
> **flags** `string`
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "192.168.1.100",
>   "pattern": "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "matches": true }
> ```

> [accordion] escape: Escape special characters
>
> Escape regex special characters so a string can be used as a literal pattern.
>
> **text** `string` *required*
>
> Text to escape.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "price is $9.99 (USD)"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "result": "price is \\$9\\.99 \\(USD\\)" }
> ```

> [accordion] validate: Check if regex is valid
>
> **pattern** `string` *required*
>
> Regex pattern to validate.
>
> **flags** `string`
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "pattern": "[a-z",
>   "flags": "g"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "valid": false,
>   "error": "Invalid regular expression: /[a-z/: Unterminated character class"
> }
> ```

> [accordion] count: Count matches
>
> **text** `string` *required*
>
> Text to search.
>
> **pattern** `string` *required*
>
> Regex pattern.
>
> **flags** `string` (default: g)
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "the cat sat on the mat",
>   "pattern": "\\b\\w{3}\\b",
>   "flags": "g"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> { "count": 5 }
> ```

> [accordion] positions: Find match positions
>
> Returns start and end positions of each match.
>
> **text** `string` *required*
>
> Text to search.
>
> **pattern** `string` *required*
>
> Regex pattern.
>
> **flags** `string` (default: g)
>
> Regex flags.
>
> **Example request:**
>
> ```json theme={null}
> {
>   "text": "Error on line 12, error on line 45",
>   "pattern": "\\d+",
>   "flags": "g"
> }
> ```
>
> **Example response:**
>
> ```json theme={null}
> {
>   "positions": [
>     { "match": "12", "start": 14, "end": 16 },
>     { "match": "45", "start": 32, "end": 34 }
>   ],
>   "count": 2
> }
> ```

> [card] [Try this free for 14 days](https://preview.condotta.ai/signup)
>
> Start a 14-day trial on Band 1. At day 14, choose your band, or stop.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.