This information type is suited when the answer should be text and is expected to be short. In computer science, this type is often called "string".
The additional options that apply are:
Minimum Length / Maximum Length
The minimum and maximum number of characters allowed for the answer.
Regular Expression / Example
Regular Expressions guarantee the provided answer conforms to a structure, like an email address.
Provide an example for the user of an acceptable answer structure. More on this below.
Information fields where Text (single line) makes sense, are:
street and number
/gi before and behind your pattern.
You get to a field that asks for an email address. You enter
hbwqff4 and try to move on. But the system stops you, explaining your entry is not a valid email address. It tells you a valid answer should look like
[email protected] . This is because the field has a regular expression provided that does not accept
hbwqff4 as a valid email.
Also called regex, regular expressions are very powerful but can be hard to write at first. To give you an idea, this is regex to validate the structure of an email address:
This consists of five parts:
At least one (signified by +) character (\w means letters and numbers) or "-"
The "@" symbol
At least one more character
Between 2 and 4 more characters
Usually, it's a good idea to reuse tested regular expressions. The website regexr.com provides a tool to build regular expressions. There, under 'Community Patterns', it contains a large library of expressions for almost every use-case. Just like the one above, all patterns can be copied freely.