regex
Written as regex(argnum flags):options in a transform expression.
| Minimum arguments | 1 |
| Maximum arguments | 1 |
| Default arguments | 1 |
| Argument modes | SINGLE_PRIMITIVE |
Documentation
Section titled “Documentation”Extract data from text using regular expressions with flexible group joining options.
Features:
- Supports standard Python regex syntax
- Flexible handling of capture groups with different joiners
- Automatically handles None values (returns None if input is None)
Joiner Options:
- Specify joiner after regex using ‘,,’ separator
- Supported joiners: ‘’, ’ ’, ‘,’, ‘,,’, ‘/’, ‘//’
- Default joiner is ‘//’ (when no joiner specified)
- Empty joiner ‘’ can be specified explicitly with ‘,,’
Important Notes:
- The joiner specification affects how multiple capture groups are combined:
- ‘//’ joins with forward slashes (default)
- ‘,’ joins with commas
- ’ ’ joins with spaces
- ‘’ concatenates without separator
- The transform will return None if no matches are found
| Flag | Letter |
|---|---|
| noncaptive_input | I |
Examples
Section titled “Examples”Basic extraction with default joiner
Section titled “Basic extraction with default joiner”Input args: ["Name: John, Age: 30"]Transforms: "regex:Name: (\\w+), Age: (\\d+)"Output: "John//30"Custom joiner (comma)
Section titled “Custom joiner (comma)”Input args: ["2023-01-15"]Transforms: "regex:(\\d{4})-(\\d{2})-(\\d{2}),,,"Output: "2023,01,15"Space joiner
Section titled “Space joiner”Input args: ["Color: Red, Size: Large"]Transforms: "regex:Color: (\\w+), Size: (\\w+),, "Output: "Red Large"No joiner (concatenation)
Section titled “No joiner (concatenation)”Input args: ["ID: ABC123"]Transforms: "regex:ID: (\\w{3})(\\d{3}),,"Output: "ABC123"Single capture group
Section titled “Single capture group”Input args: ["Error: File not found"]Transforms: "regex:Error: (.+)"Output: "File not found"