/
Phone Validation Regex Pattern

Phone Validation Regex Pattern

Go to System → Settings → Checkout

Validate different formats of phone numbers using regular expressions. The Phone number is not required in the customer registration however you can require customers to enter the phone number in the Checkout settings → Require Phone Number at Checkout.

regular expressions

The default Phone Validation Regex Pattern /^[0-9]{3,32}$/ is a simple expression that will check if the number has a minimum of 3 digits and a maximum of 32 and nothing else.

To allow anything to match use the /(.*?)/ regex. 

While it's challenging to create a single pattern that covers all possibilities, here's a general approach that can handle many common formats /^[0-9\+\(\)\.\s\-,]+$/

If you modify the phone number validation regex in AbanteCart, you'll likely need to adjust the corresponding error messages displayed to customers in the Language Definitions. Search for the definitions with the key error_telephone

Related content

Require Phone Number at Checkout
Require Phone Number at Checkout
More like this
Settings types
More like this
Review New Registrations
Review New Registrations
More like this
Telephone & Fax
Telephone & Fax
More like this
Captcha on create account form
Captcha on create account form
More like this
Countires
Countires
More like this

AbanteCart, all rights reserved. 2025 ©