Docs
RunMacro Documentation
Learn RunMacro from basics to advanced.
Everything you need to start and master RunMacro — from basic commands to advanced automation workflows.

Extract data with Regex into a variable in RunMacro
What it does
The Extract Regex command uses a regular expression to pull a piece of data (OTP, email, number...) from a variable, text, or the clipboard, then stores it in a variable.
When to use it
- Grab a 6-digit OTP from a message/email.
- Pull an email or phone number from a block of text.
- Isolate the needed data before using it.
Configuration steps
- Add a Variables › Extract Regex command.
- Choose the source (Variable / Text / Clipboard) and enter the source value.
- Enter the regex pattern (e.g.
\d{6}for 6 digits) and the result variable. - (Optional) choose the group/match index. Save.
Every option explained
Real example
Example: extract a 6-digit OTP from the clipboard
- Copy the message containing the OTP.
- Extract Regex: source Clipboard, pattern
\d{6}→ variableotp. - Use
{otp}to fill the code field.
Tips & common mistakes
Test the pattern on an online regex tool first to be sure it matches the right part.
RunMacro