How do you mean studly?
If you mean, 1 UPPER, 1 lower, 1 UPPER, 1 lower, then the following match code should work.
The nickname other the person you are testing, should be contained in the $nick variable
Code: Select all
set U 0
set Z 0
set I 0
foreach c [split $nick {}] {
if {![string match {[A-Za-z]}]} { continue }
if {!$i} { if {[string is upper $c]} { set U 1; set Z 1; continue }
set i 1
if {$U} {
if {[string is lower $c]} { continue }
} else {
if {![string is lower $c]} { continue }
}
set Z 0
break
}
This is far from perfect, and only 1 double single case will get around it (EG PpSlIm will be matched, while PpSliM will get around it).
After this code it done, if $Z is equal to 1, then they are using being matched as above, if set to 0, then they are home free.