Replace Text
Command description
Replaces text, numbers, phone numbers, email addresses, ID numbers, or custom regular-expression matches and saves the result as a new variable.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Content Source | any | Source content. List items are joined with newline characters; other values are converted to strings before replacement. |
| Replacement Method | enum | Replace Text, Replace Number, Replace Phone Number, Replace Email, Replace ID Number, Custom Regex |
| Text to Replace | any | Plain text or regular expression to match. Required when Replacement Method is Replace Text or Custom Regex |
| Replace First Match Only | bool | Whether to replace only the first matching content |
| Ignore Case | bool | Whether to ignore English case when matching |
| Replacement | any | New content used to replace the matching content. It can be empty and will be converted into a string at runtime. |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Replacement Result | str | Replaced text |
Note
In Replace Number mode, signed integers and decimals are replaced, including numbers adjacent to letters. For example, Order A1024 amount CNY 29.8 replaces 1024 and 29.8.
Replace Text treats Text to Replace as literal text. Custom Regex treats it as a Python regular expression.
JSON workflow example
[
{
"ins": "Replace Text",
"in": {
"Content Source": "'Order A1024, amount 29.8'",
"Replacement Method": "'Replace Number'",
"Replace First Match Only": "False",
"Ignore Case": "False",
"Replacement": "'*'"
},
"out": {
"Replacement Result": "replaceText"
}
}
]
AI Workflow Generation Notes
- Use Custom Regex only when regular-expression matching is required.