Code: Select all
if {[regexp -nocase -- {[\[\]\{\}\]]+} $text]} {sendcmd "privmsg $chan :Illegal characters in nick: \[\]\ \{\}\ ";return}

The "sendcmd" procedure is a custom one of mine.
Code: Select all
if {[regexp -nocase -- {[\[\]\{\}\]]+} $text]} {sendcmd "privmsg $chan :Illegal characters in nick: \[\]\ \{\}\ ";return}
Code: Select all
if {([string match "*\[*\]*" $text]) || ([string match "*\{*\}*" $text])} { sendcmd "PRIVMSG $chan :Illegal characters in nick: \[\]\ \{\}\ "; return 0 }
Code: Select all
if {([string match "*\[*\]*" $text]) || ([string match "*\{*\}*" $text])} { sendcmd "PRIVMSG $chan :Illegal characters in nick: \[\]\ \{\}\ "; return 0 }
Code: Select all
if {(([string equal "\[" [string index $nick 0]) && ([string equal "\]" [string index [expr [string length $nick] - 1]]])) || (([string equal "\{" [string index $nick 0]) && ([string equal "\}" [string index [expr [string length $nick] - 1]]]))} { sendcmd "PRIVMSG $chan :Illegal characters in nick: \[\]\ \{\}\ "; return 0 }