Controlling a telephone number input like as 01-23444 or 022-234545 or 351-3445667

Hi Kal,
I tried new thing for telephone number input like:
01-23444 or 022-234545 or 351-3445667
Or can I do free input of number with “-” max 12 character or 14 Character so it could also take less characters, any suggestion

Hi @LeoM
I would suggest running a search command on the community forum or checking the support articles and trying it first. What you are looking for is covered within the support articles.

1 Like

Hi @LeoM,

For: 01-23444

regex(., ‘^[0-9]{2}-[0-9]{5}$’)

For: 022-234545

regex(., ‘^[0-9]{3}-[0-9]{6}$’)

For: 351-3445667

regex(., ‘^[0-9]{3}-[0-9]{7}$’)

As suggested by @stephanealoo, kindly please follow our support article for more details and examples.

Hi Kal,
Is it possible to do such so that people can input max 00-000000000(2digit- 9 digit) and lessany digit for( 2digit- any digit less than or eual to 9 digit
For e.g
01- 12
or, 02-123
or, 13-1234
or 43- 12345…=<9 (but not more than 9 digit after 2 digit city code)

You mean to say:

  • 2 digit is compulsory at the beginning.
  • Then you have a -.
  • Any number of digits between none to 9.

Is this what you are trying to construct?

any number in between 9 digit

Try this out:

regex(., ‘^[0-9]{2}[-]{0,1}[0-9]{0,9}$’)

1 Like