Using the regexes already presented here:
alias fnick return $fline($1,/^<[\Q $prefix \E]? $+ $$2> ./i,0,2)
; Example: //echo -a whoami wrote $fnick(#mirc,whoami) lines
To anyone trying out this code: note that it is tailored for whoami, as he doesn't use a timestamp, and the regex is not incorporating for it neither. Moreover, if you use a theme of some sort that displays the nick differently, obviously it won't work. It would have to be tailored exactly to fit your specific needs.