Phone number

Below is a validation for phone numbers. For additional validation, please see Using regular expressions from the LimeSurvey Manual.

The following validation:

  • Works for all Canadian & US phone numbers. For phone numbers from other countries, please see the phone numbers section from LimeSurvey manual.
  • Works for phone numbers that include non-digit symbols including . ( ) - (space) which will allow you to match phone numbers such as:

    • (555)555 5555
    • 555.555.5555
    • 555 555 5555
    • (555)-555-5555
    • 555-555-5555
    • 555555555

Steps for phone number validation:

Ensure the Question Type is Short free text.

  1. Add a new question or edit an existing question
  2. Under General options (right-hand side):
    1. Make sure Question type is Short free text
    2. Copy and paste the validation expression (below) into the Validation field 

Validation expression: /^[\(\)\.\- ]{0,}[0-9]{3}[\(\)\.\- ]{0,}[0-9]{3}[\(\)\.\- ]{0,}[0-9]{4}[\(\)\.\- ]{0,}$/

phone valid.jpg