🤖 Master Regex in Seconds with Zaia AI (No Coding Required!)
Regular Expressions (RegEx) are incredibly powerful for extracting specific data from text—like finding an invoice number, a dynamic URL, or an email address. But let’s be honest: writing RegEx code from scratch feels like writing in an alien language. ^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$ ...right? 🤯
With Zaia (Zenphi AI), you don't need to know how to write the code. You just need to know how to ask for it.
Here is your guide to using the AI Copilot to master Regex.
⚠️ Step 1: Choose the Right Action
Before you click the AI button, make sure you have dragged the correct action to your canvas. Zenphi has three Regex actions, and confusing them is common!
Split Text with RegEx:
Use this to: Chop a text block into pieces (e.g., splitting a paragraph into sentences or a CSV string into a list).
Find Values (Plural) with RegEx:
Use this to: Extract ALL matches found in the text (e.g., extracting every email address from a document).
Find Value (Singular) with RegEx:
Use this to: Extract just the single specific match (e.g., the first URL found in a header).
✨ Step 2: Ask Zaia (The Prompt Matters)
Once you open the action settings, click the ZAIA option (green AI button).
The golden rule here is: "The better the description, the better the pattern."
Bad Prompt: "Get link."
Good Prompt: "Extract the URL starting with 'https' that appears after 'callback-url'."
You can also paste a sample of your text into the prompt box to help Zaia understand the context of what it is looking at.
đź§Ş Step 3: Test It Immediately
One of the best features of the AI modal is the built-in Test function. You don't need to publish and run your flow just to see if the Regex works!
After Zaia generates the code, click the Test tab.
Paste your sample text (e.g., your Header string or email body).
Click Run Test.
Zaia will highlight exactly what the pattern captures so you can verify it works before saving.
đź’ˇ Pro Tip: The "Reverse Test" Trick
Do you already have a Regex pattern (maybe from StackOverflow or ChatGPT) but you aren't sure if it works correctly in Zenphi?
You can use the AI Tester for your own code too!
Open the AI generator.
In the prompt box, type: "Return this pattern back to me: [PASTE_YOUR_EXISTING_REGEX]"
Zaia will simply output your code into the editor.
Now you can use the Test tab to run your sample data against your existing code without running the whole flow!