write a regular expressions to fetch all the valid ip's
Answer Posted / saravanan6060
set ip "244.168.123.23"
regexp {([0-9]+).([0-9]+).([0-9]+).([0-9]+)} $ip match a b c d
if {$a <=255 & $b <=255 & $c <=255 & $d <=255} {
puts "$ip is valid ip address"
} else {
puts "$ip is not valid address"
}
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers