Probably not the best way to do this, but...
on @*:join:#chan: {
var %ident $gettok($gettok($address($nick,0),2,33),1,64)
if ($mid(%ident,2,1) isletter && $mid(%ident,3,20) isnum) {
ban -k $chan $nick
}
}
You can change the ban to be on one of the $address types if you wanted a different type of ban. This should do what you want.
As I said, there may be a better way to do this. This is just what I did while I work.
