29.03.2018, 05:40
Is this correct usage of this plugin's functions?
pawn Code:
#if defined _pawnregex_included
regex_IsValidIP(const string[])
{
// = \\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)+([(/|,.)?\\s]{1,})+(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)+([(/|,.)?\\s]{1,})+(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)+([(/|,.)?\\s]{1,})+(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b // Pooh7's second
// = ([0-9\\s]{1,})+([(\/|_,.)?\\s]{1,})+([0-9\\s]{1,})+([(\/|_,.)?\\s]{1,})+([0-9\\s]{1,})+([(\/|_,.)?\\s]{1,})+([0-9\\s]{1,}) Pooh7's
// = (.*?)([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})(.*?)
// = ((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([\s\.\$]+)){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\s*:\s*[0-9]+)?
new
result,
regex:ipRegex = Regex_New("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)([\s\.\$\,\_\-\@\!\#\+\=\<\>]+)){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\s*:\s*[0-9]+)??");
result = Regex_Check(string, ipRegex);
Regex_Delete(ipRegex);
return result;
}
#endif