Custom validators are great to add additional validation to your pages. They alert the supporter that a field hasn't been input in the correct format.
You can create new validators by going to Pages > Alerts & validators > Validators. When you create a new one, choose the Validator Type of "Custom". The custom code uses a language called "regex". You can learn about regex on sites like https://regexone.com and test your regex code before applying it to your pages at sites like https://regex101.com.
Below we'll include some example custom validators which you can use to modify your own use
^.{1,100}$
^\d{0,10}$
^(0[0-9]{9})?$
[a]+
^[^<>~%]+$
^$|^[^<>~%]+$
^[a-zA-Z]*$
Address field - Can be blank OR contain letters, numbers, commas, spaces, dots, slashes, dashes, apostophes
^$|^[A-Za-z0-9\s\-\\\/.,—'’]+$
UK Postcode validator (based on one supplied by UK government). Will also allow blank postcodes which can be picked up by the mandatory option instead
^$|([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})
^\w+[-\.\w]*@(?!(?:qq|163|pp)\.com$)\w+[-\.\w]*?\.\w{2,4}$
^((?!@hotmial|@gmial).)*$
^\d{6}$
^\d{8}$
^\d{16}$
Must not contain any characters at all (i.e. be blank) - good for a spam trap since bots usually auto-fill all fields
^$