RegEx variable
Replace a text variable with what a regular expression matches, or with a replaced version.
In both apps
WarpX Browser
WarpX Phone
RegEx variable runs a regular expression over a variable that holds text, and writes the result back into the same variable. Use Match value to pull a piece out, or Replace value to rewrite it, for example to reformat a date.
Settings
- Variable name
The variable to work on. It must hold text, and it is overwritten with the result.
ExampleshipDate- Method
Match value keeps what the expression matches. Replace value replaces each match.
ExampleReplace value- Replace withwhen Method is Replace value
What each match becomes.
$1,$2and so on insert the expression's groups, and references such as{{variables.x}}are filled in. Leave it empty to delete the matches.Example$3-$2-$1- RegEx
The expression, without the surrounding slashes.
Example(\d{2})/(\d{2})/(\d{4})- Flags
The button next to the expression. Tick global to act on every match, ignore case, or multiline.
Exampleg
Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.
What it hands on
Overwrites the variable with the result and hands the result on as {{prevBlockData}}.
Example: Turn a day/month/year date into year-month-day
- Start
- Open URL
- Get text
- RegEx variable
- Insert data
- Read the shipping date, such as
19/09/2026, into a variable namedshipDatewith Get text. - Add RegEx variable and type
shipDatein Variable name. - Set Method to Replace value and Replace with to
$3-$2-$1. - Type
(\d{2})/(\d{2})/(\d{4})in RegEx and tick global under the flags button. - Run it.
shipDateis now2026-09-19.
Good to know
- Match value without global keeps the whole first match as text, not a group. With global it keeps a list of every match. With no match, the variable becomes empty (
null). - The variable must hold text. A value that Insert data stored as a number, such as
129.90, stops the block withis not a string/text. - A missing variable stops the block with
Cant find "shipDate" variable. - References are filled in only in Replace with, not in RegEx or the variable name.
- For a variable whose name starts with
$$, only this run's copy changes.
See also
- Slice variable — Keep part of a variable's text or list, by position.
- Get text — Read the text of one element or many, and save it to the table or a variable.
- Insert data — Set variables and add values to the workflow's table, several at once.