Custom field regular expression

  • Posts: 197
  • Thank you received: 13
1 year 2 months ago #348771

-- HikaShop version -- : 4.7
-- Joomla version -- : 4.2.6
-- PHP version -- : 8.1

Hi.

i have created a custom for users.
can you help me with writing a regular expression for it ?

I want the field only accepts inputs which is a 11 digit numbers which starts only with 09

expamle of valid input : 09123456789
example of invalid input : 652147859, khashayar

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

  • Posts: 4519
  • Thank you received: 611
  • MODERATOR
1 year 2 months ago #348772

Hello,

Usually we didn't provide regex, as there are many website that can help you to build your Regex (and test it), here I google this :
"only 11 digit number start with 09 regex" in Google as it seems to us that you request looks very classic.
and we get this url from stackoverflow, where you will find this result :

'^09\d{9}$'

Other hint as we do ourselves as in ChatGPT, same result.
Hope this will help you.

Regards

Last edit: 1 year 2 months ago by Philip.

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

  • Posts: 197
  • Thank you received: 13
1 year 2 months ago #348784

before asking this question, i googled my question and I relized that there are diferent types of regular expressions

i did not know whether i should use PHP regex syntax or javascript regext syntax so I ended up asking it from you

thank you

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

Time to create page: 0.057 seconds
Powered by Kunena Forum