So, really what you need to do is check the second octet.

$2nd = Val(SUBSTR(@ipaddress0, 5, 3))

See also, the FAQ

Topic: IP Address trimming
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.