06.09.2014, 18:52
Maybe this could help.
Credits aren't mine tho.
pawn Code:
stock stringContainsIP(string[])
{
new
dotCount
;
for(new i; string[i] != EOS; ++i)
{
if(('0' <= string[i] <= '9') || string[i] == '.' || string[i] == ':')
{
if((string[i] == '.') && (string[i + 1] != '.') && ('0' <= string[i - 1] <= '9'))
{
++dotCount;
}
continue;
}
}
return (dotCount > 2);
}