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
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
try eg.
^(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})(.(?!$)|$)){4}$
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})$
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 ...
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.