Postal code
Below is a validation for postal codes. For additional validation, please see Using regular expressions from the LimeSurvey Manual.
The following validation:
- Works for Canadian postal codes. For postal codes in other countries, please see the postcodes section from the LimeSurvey manual.
- Is case insensitive
- Works for the following formats:
- A1B2C3 (no space)
- a1B 2C3 (space)
- a1b-2c3 (dash)
Steps to add postal code validation:
Ensure the Question Type is Short free text.
- Add a new question or edit an existing question
- Under General options (right-hand side):
- Make sure Question type is Short free text
- Copy and paste the validation expression (below) into the Validation field
Validation expression: /^[a-zA-Z]\d{1}[a-zA-Z](\-| |)\d{1}[a-zA-Z]\d{1}$/