Google Forms response validation builder
Pick what the answer has to be; get the pattern, the operation to pair it with, and an error message worth reading. A Forms regex has two halves and the internet only ever hands you one of them — the pattern travels, the operation does not, and picking the wrong operation is why a rule that looks strict lets fake answers straight through.
Pick what the answer has to be, then hit Build.
You'll get the pattern, the operation to pair it with, an error message, and a table of answers tried both ways:
^\d{10}$
Nothing is sent anywhere but this page, and nothing is stored.
How the two operations behave
This is the fact the whole tool turns on, and it was established by
submitting real answers to a real published form rather than by reading the
documentation. One question, one pattern — \d{10} — three
answers, submitted signed out:
| Answer | Matches \d{10} | Contains \d{10} |
|---|---|---|
5551234567 | accepted | accepted |
call me 5551234567 ok | rejected | accepted |
555 | rejected | rejected |
So Matches already requires the whole answer to be the pattern — the
^ and $ are belt-and-braces there, not
load-bearing. Anchor anyway: the day someone switches the dropdown to
Contains, they are what stops the rule going quiet.
Two more things worth knowing before you paste a pattern from anywhere else. Google Forms runs RE2, which has no lookaheads and no backreferences, so most "password strength" patterns on the web cannot work in Forms at all. And validation only exists on short answer and paragraph questions, and never fires on a question nobody answered — pair it with Required.
Seeing it done
The channel builds this exact rule on camera — the hidden three-dot menu, the
two dropdowns, the pattern — and then publishes the form and tries to break it
in How to Validate Phone
Numbers in Google Forms. The rejection you see at the end is the
Matches row of the table above, happening for real.