Field Validation with Regex in Array
A simple “search and replace” might work for basic tasks, but it often falls short when trying to validate dynamic or complex input. That’s where regex (regular expressions) come in.
With Array's regex-based data verification, you can make sure entries like email addresses, phone numbers, or credit card details match the exact format you need — helping prevent invalid submissions.
Why Use Field Validation?
Let’s say you have a field labeled Email. Without validation, a user could type anything — even “abc” — and your form would still accept it. That’s not helpful.
Regex lets you define patterns such as:
✅ Must be a valid email address (e.g. name@example.com)
✅ Must be a 10-digit phone number
✅ Must contain only numbers
✅ Must match a specific format (like a postal code or ID number)
How to Add Field Validation in Array
Adding regex validation is simple:
Open your form in the Array Form Builder.
Click on the field you want to validate (e.g. an Email or Phone Number field).
In the field settings, click “Rule (Regex)”.
Enter your regex pattern into the field.
Example: Email Validation
If you want to ensure the user enters a valid email, just choose the Email field type — Array automatically applies regex validation for you.
No extra setup needed!
Coming Soon: Auto-Populated Regex Rules
We’re making validation even easier. Currently, we’ve automated regex rules for email fields, and we’re actively working to expand this to:
Phone numbers
Postal codes
Credit card numbers
Custom ID formats
And more
Soon, adding strong field validation will be as simple as choosing the right field type.
Tip: Need Help with Regex?
Regex can be tricky if you’re not familiar with it. If you're unsure about what pattern to use, check out our upcoming regex pattern library or reach out to support.
You can also use free online tools like regex101.com to test and build your expressions before adding them to your form.
Summary
Regex helps validate user input to ensure data is correctly formatted.
Add validation by using the “Rule (Regex)” option on any form field.
Email fields come with built-in validation.
More auto-populated validations are on the way!
