Replace / String Layer
Replace patterns in text with new content. Similar to Python's re.sub() or str.replace(). Supports both regex and literal string replacement. Useful for:
- Text cleaning and standardization
- Formatting data patterns
- Correcting common errors
- Anonymizing sensitive information
Table
0
0
Table
Select
columnThe string column to perform replacements on. Original values remain unchanged if no matches are found.
Pattern
stringPattern to find and replace. Can be regex or literal based on Literal
setting. Examples:
- \d+ for replacing number sequences
- (Mr|Mrs|Ms).? for title normalization
- [A-Z]\w+ for word replacement
ReplaceWith
stringText to insert in place of matches (ReplaceWith
). Examples:
- [REDACTED] for sensitive data
- standardized format for inconsistent values
- empty string to remove matches
Literal
boolIf true
, treats Pattern
as exact text rather than regex. Useful for:
- Simple text substitution
- When pattern contains regex metacharacters
- Exact phrase replacement
N
u32Maximum number of replacements (N
) to perform per string. Examples:
- 1: replace first occurrence only
- 2: replace first two occurrences
- 0: replace all occurrences
AsColumn
nameName for the new column. If not provided, the system generates a unique name. If AsColumn
matches an existing column, the existing column is replaced. The name should follow valid column naming conventions.