match, matchAll, search, replace, and replaceAll.
Overview
The Regex command provides functionality for:- Matching patterns in string fields
- Replacing substrings using regex patterns
- Searching for pattern occurrences
- Applying flags like
g,i,m,u,sfor fine-grained control
Command Type
Command Type ID: 1009Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| methodName | string | The regex method to apply. Possible values: "match", "matchAll", "search", "replace", "replaceAll" | Yes |
| pattern | string | The regex pattern to apply | Yes |
| flag | string | Optional regex flags (e.g. g, i, m, u, s) | No |
| replaceValue | string | The replacement value for replace or replaceAll methods | No |
| source | string | The key in the data source to apply the regex on. If not provided, operates directly on the data | No |
Usage Examples
Match a Pattern
Replace a Substring
Replace All Occurrences
Case-Insensitive Match
Supported Methods
| Method | Description |
|---|---|
match | Returns the first match of the pattern |
matchAll | Returns all matches of the pattern |
search | Returns the index of the first match |
replace | Replaces the first match with replaceValue |
replaceAll | Replaces all matches with replaceValue |
Common Use Cases
- Data Cleaning: Remove or replace unwanted characters from string fields
- Pattern Extraction: Extract numeric IDs, codes, or tokens from raw text
- Normalization: Standardize formats (e.g. date strings, phone numbers)
Related Commands
- String Manipulation - Apply JS string methods to fields
- String Split - Split strings by a delimiter
- Filter - Filter objects after regex extraction