# `Fields.Validate`

Helper functions to validate the data in certain fields

# `address`

Validate an address.
Currently just validates that some input has been given.

# `email`

Validate the format of an email address using a regex.
Uses a slightly modified version of the w3c HTML5 spec email regex (https://www.w3.org/TR/html5/forms.html#valid-e-mail-address),
with additions to account for not allowing emails to start or end with '.',
and a check that there are no consecutive '.'s.

# `ip_address`

# `name`

Validate the length of a name is less than 35 characters

# `phone_number`

Validates the format of a UK phone number.

# `postcode`

Validate the format of an postcode using a regex.
All existing postcodes in the UK should pass this validation;
some non-existent ones may too if they follow the standard UK postcode format.

# `url`

Validate the format of a url using a regex.
See https://stackoverflow.com/questions/42522442/how-to-validate-a-url-via-a-check-constraint-in-postgres/51965621 for details on how the regex for validation was chosen

---

*Consult [api-reference.md](api-reference.md) for complete listing*
