I am working on a contract form hosted on Firebase. User can submit a form without authorization (anonymous authorization only). I have client side data validation on form but i struggle to test email with regular expression via Firestore security rule on the server side. Here is what i have in RE2 syntax:
allow create: if request.resource.data.email.matches("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i");I have tried without "/", also does not work. Following regex works perfectly for telephone number, however:
allow create: if request.resource.data.tel.matches("^[+][0-9]{9,}$");Thanks in advance!