Skip to main content

Regular expression on postal code field not working

More
4 years 3 months ago #342661 by remcovolbeda
-- url of the page with the problem -- : paintmaster.nl
-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0.20
-- Browser(s) name and version -- : all browsers
-- Error-message(debug-mod must be tuned on) -- : no error message

Hi,

I can not get the regular expression to work in "display / custom fields / address_post_cde . The expresson I use is this:

/^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$/i

For dutch postal codes like "1039 AA" and "3224cc"

I have set the field to "Required", but all entries say that it is not a right postal code. Even a very simple regular expression never validates right.

Kind regards,
Peter

Please Log in or Create an account to join the conversation.

More
4 years 3 months ago #342663 by nicolas
Hi,

You should only use:
Code:
^[1-9][0-9]{3}[\s]?[A-Za-z]{2}$
The / around are added by HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.190 seconds
Powered by Kunena Forum