Regular expression on postal code field not working

  • Posts: 14
  • Thank you received: 0
  • Hikashop Business
4 days 9 hours ago #342661

-- 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.

  • Posts: 75835
  • Thank you received: 11829
  • MODERATOR
4 days 6 hours ago #342663

Hi,

You should only use:

^[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.054 seconds
Powered by Kunena Forum