I'm trying to do a wildcard search using $hfind, where the search pattern is stored in a string or a variable but I can't get it to work. I did find a post (https://forums.mirc.com/ubbthreads.php/topics/260913/how-to-use-a-wildcard-pattern-a-variable) with a very similar problem but using $read instead of $hfind. Not sure if that's why the method explained there didn't work.

I create a test table (mytable) and populate it with:

hadd mytable user.adam hi
hadd mytable user.bob hi
hadd mytable user.bill hi
hadd mytable user.chad hi

Then I have an ON TEXT to check the table:

on *:TEXT:!test *:#:{
var %i = $hfind($2,$3,0,w)
msg $chan found %i matches
}

And I trigger it with:

!test mytable user.b*

I expect it to find 2 matches but doesn't. I also tried putting $3 into a var and using $hfind($2,%temp,0,w) but nothing there either. And I tried using $+'s, surrounding it with $eval(), using []'s but none of them worked. If "!test mytable user.*" is the input, then "$hfind($2,$3,0,w)" should execute as "$hfind(mytable,user.b*,0,w)", treating the * as a wildcard, right? What am I missing here?!