http://forum.mikrotik.com/t/how-to-check-if-special-character-is-present-in-the-message/168997/4
Instead of lost time to identify unsupported RouterOS characters (from 0x80 to 0xFF) or invalid / not printable / with problems,
simply:
:global uvalid do={
# \2D = -
# \2E = .
# \30..\39 = 0..9
# \40 = @
# \41 .. \5A = A..Z
# \5F = _
# \61..\7A a..z
# so, in this case, the accepted characters are: - . 0..9 @ A..Z _
:if ($1~“[\01-\2C\2F\3A-\3F\5B-\5E\60\7B-\FF]”) do={ return false }
:return true
}
{
:local uname “inval!d=user”
:put “$uname is valid is $[$uvalid $uname]”
:local uname “Av@l1d_user.”
:put “$uname is valid is $[$uvalid $uname]”
}