It’s not exactly what I asked, but I think it’ll work for my purposes. I’m still curious how to interpolate a variable inside a nginx PCRE regex if anyone else knows!
set $chk == "need";
set $me "kevin";
if ($uri ~ /by-([^-]+)/) { set $by $1; }
if ($by = $me) {set $chk "";}