It's your lucky day, there was just now posted something very similar right
here That should work out for you.
Btw the reason it matched was because of the question mark. It will look in your text file for this *?* but a question mark is a wildcard itself, meaning match 1 character, so it will match on any multitude of characters due to the * * around it, which it did.
The same problem would occur with an asterisk.
Anyway using $read for this is not an option, I think Sladekraven and you have misunderstood how the matchtext works. If you specify a wildstring in the $read identifier, it will look in your text file for the whole line inputted to match as a whole.
Example:
If someone says "hi ricky how are you doing?"
Your script will transform it into *hi ricky how are you doing?* and will look in you text file to see if that line is in it. Even though you might have *ricky* or *hi* or *you* etc in it, it won't match, as it's looking for the whole line to match.
That's why its much better to use a hash table and $hfind, which is displayed in the thread I linked you too. $hfind can tell mIRC that the hash table items have to match against the string, which is exactly what you want.
Greets