you could use

set %nick $nick(#,$fline(#,* $+ $left($?1,-1) $+ *,1,1))

that way its looking for *nick* the only problem with using things like that is the chance of hitting the wrong nick esculates.