Skip to main content
Nintex Community Menu Bar

Restrict text field to accept only numbers and dots

  • May 23, 2018
  • 3 replies
  • 27 views

Forum|alt.badge.img+2

Hi I would like to restrict the field with numbers and dots(.) using RegEx expressions.

Please guide me. For example, this is actually an IP Address

10.111.123.23
10.111.151.150

3 replies

Forum|alt.badge.img+14
  • Scholar
  • May 23, 2018

try eg.

^(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(.(?!$)|$)){4}$

Forum|alt.badge.img+2
  • Author
  • May 24, 2018

Hi Marian

It should not accept this also, please refer below screen shot. The above regex is accepting two digits after first dot/decimal, it should not accept. The format should be like this. xx.xxx.x/xx/xxx.x/xx/xxx . Here "/" is OR.

What about this - ^([0-9]{2}.[0-9]{3}.[0-9]{1,3}.[0-9]{1,3})$

215589_pastedImage_1.png


Forum|alt.badge.img+14
  • Scholar
  • May 24, 2018

then I'd define the pattern like follows

^[0-9]{2}.(25[0-5]|2[0-4][0-9]|[01][0-9]{2}).(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2}).(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$

your pattern would match as well input like 10.999.999.999 which is not valid IP address ...