jaytea commented on a Page, IP address functions  -  Apr 07, 2011

did you intentionally avoid using $longip()? :P with it, you can map valid IPv4 addresses onto their integer counterparts, making them much easier to compare. it also implicitly validates them: an integer return value implies a valid IPv4 address. mIRC 7.1 also introduced a new $iptype() identifier which returns 'ipv4' if the input is a valid such address.

careful with /tokenize though: $isipaddress(1...1...1...1) = $true. also, due to using isnum, $isipaddress(+1.-0.+00000002.+3) = $true. making these kinds of things bulletproof is often a pain ;P

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.