Your regex is kinda incorrect. You have a trailing : at the end and you do nothing with it. You validate it only until 90.40.33.22: and that's it. Another thing is that you call it on plugin initialization. I'd rather do that on client_putinserver, but you know best, you are the scripter after all.
Now you have two possibilities regarding the regular expression:
Add a trailing \d+ after the : or take a look at the regex below.
PHP Code:
^(?=\d+\.\d+\.\d+\.\d+\:[0-9]{1,5}$)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\.?){4}\:[0-9]{1,5}$
What's actually happening?
We have a positive lookahead
PHP Code:
(?=\d+\.\d+\.\d+\.\d+\:[0-9]{1,5}$)
and a non-capturing group with 5 alternatives
PHP Code:
(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])
. The rest of it you can understand it yourself with all the digit validations and the range of it. You can sum 2 by 2.
So your regex would look something like the following:
PHP Code:
new Regex:regex_handle = regex_match(mUserName, "^(?=\d+\.\d+\.\d+\.\d+\:[0-9]{1,5}$)(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\.?){4}\:[0-9]{1,5}$", ret, error, charsmax(error))
PS:
Another thing, I would also use compiled regular expressions and use regex_match, not relying on the handle itself. Just a point of view, I guess.