Introduction
Google Forms is a powerful tool for collecting responses, but ensuring valid email input requires proper validation. This guide covers how to enforce email format restrictions using regular expression.
Using Regular Expressions for Advanced Email Validation
Google Forms allows regex-based validation for granular email validation:
- Enable Regex Validation:
- Click on the question field.
- Open the three-dot menu (
⋮
) and selectResponse Validation
. - Choose
Regular Expression
→Matches
.
- Use a Regex Pattern:
- Example regex for email validation:
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
- This ensures the email follows a valid format.
- Example regex for email validation:
- Customize Error Message: Provide a clear message like "Enter a valid email address (e.g., user@example.com)."