Validation For Address Field - Letters, Numbers and Punctuation

I want to validate an address field, which may look like:

2 Any Street,
Anytown,
UK.

So I want letters, numbers and basic punctuation.

I can’t see a validation option which works for this… will I need to use Regex?

You can use a regex validation pattern:

^[A-Za-z0-9\s,.'-]+$

This will match addresses that can contain letters (both uppercase and lowercase), numbers, spaces, commas, periods, single quotes, and hyphens.

1 Like