Google Forms gives you the option to check that respondents answer your questions the way you want through what is called data validation. For instance, you can make sure that if you ask for an email address, the response typed in is, in fact, an email address. Google Forms has several simple, user-friendly options for data validation that I describe in my tutotial here. If these options are not enough, you can create your own custom data validation rules for text and paragraph questions using a common programming technique called regular expressions.
Regular expressions are basically a way to describe text patterns. When you set up regular expressions in Google Forms, the form will check to make sure that the answer typed in matches the pattern. Regular expressions are powerful, but they require some coding know-how. Much could be said on this topic, and you can check out this quick start guide for a more in-depth lesson. The steps in this tutorial describe how to use regular expressions in Google Forms.
Note: Data validation is not yet available in the new version of Forms.
1.Open or create a Google Form, and write your questions. If you need help with this step, see my tutorial here.
2.Go to a Text or Paragraph Text question, and click on Advanced settings at the bottom of the page. Check the box for Data validation, and select Regular Expression from the first drop down menu. The next menu lets you determine if the answer will contain, not contain, match, or not match your regular expression.
4.Add an optional custom error text. The custom error text is what the respondent will see if they answer your question incorrectly. For example, suppose you have a question that asks for a telephone number in a specific format. You could say in your custom error text “Answer must be formatted (###)###-####” if someone types in anything that does not match your regular expression.
Are you daunted? If you know exactly what you want, but do not know the proper syntax, try searching for it online. Most of the time you will be able to find a forum with the regular expression typed out for you to copy and paste.