You can use regex (Regular Expressions) in your Polling.com questions to control the format of responses. By adding a regex pattern in the Pattern Validation field, you ensure that responders submit their answers in the format you specify.
If you're new to Regular Expressions or want to explore further, we recommend visiting these helpful resources:
To Set Up Regex Pattern Validation in Polling.com, follow these steps:
Create your survey question.
Click "Settings" on the question where you want to apply regex validation.
Enter a placeholder.
💡 This gives your respondents a hint about the expected format (e.g., 123-456-7890).
Example: \d{3}-\d{3}-\d{4} enforces a phone number format like the placeholder.
📌 Basic Building Blocks of Regex:
Symbol | What it means | Example | What it matches |
---|---|---|---|
`.` | Any character (except newline) | `a.c` | Matches "abc", "a1c", "a-c" |
`*` | Zero or more of the previous thing | `ba*` | "b", "ba", "baa", "baaa" |
`+` | One or more of the previous thing | `ba+` | "ba", "baa", "baaa" (not "b") |
`?` | Optional (zero or one) | `ba?` | "b", "ba"(not "b") |
`[]` | Match any character inside | `[abc]` | "a", "b", or "c" |
`[^]` | NOT these characters | `[^a]` | Any character except "a" |
`\d` | Any digit (0–9) | `\d\d` | "23", "99" |
`\w` | Word character (a–z, A–Z, 0–9, \_) | `\w+` | "hello", "test123" |
`\s` | Whitespace (space, tab, newline) | `\s+` | One or more spaces/tabs |
`^` | Start of a line | `^Hi` | "Hi there" at the beginning of a line |
`$` | End of a line | `bye$` | "Say bye" if "bye" is at the end |