30.06.2012, 17:07
You can use this stock (I did not make it).
Then you can use:
pawn Код:
stock detectIP(text[])
{
new
dotCount
;
for(new i; text[i] != 0; ++i)
{
if('0' <= text[i] <= '9')
{
do
{
if(text[i] == '.') ++dotCount;
++i;
}
while(('0' <= text[i] <= '9') || text[i] == '.' || text[i] == ':');
}
else dotCount = -1;
}
return (dotCount > 2);
}
pawn Код:
if(detectIP(sometext)) {
// If there's an IP in the text
}
else {
// No IP in the text
}