I'm a little confused.. what's wrong with just using the regex switch? it seems to me like the conversion between wildcard and regex is trivial enough that it shouldn't really matter. IMO if there's already a reasonable way to achieve case sensitive searching that *works*, there's no real need to add another.
FWIW: a wildcard "*" becomes ".*", "?" becomes ".?" and "&" becomes "\S+" when translating to regex.
"?" would actually be "^.$" when used on its own, and ".", "^." or ".$" (depending on the position of the wildcard being middle, beginning or end of the string respectively) when used with other text to match. See for yourself:
alias test {
echo -a $iif(? iswm $null,yes,no) ~ $regex($null,/^.?$/)
echo -a $iif(?a iswm a,yes,no) ~ $regex(a,/^.?a$/)
echo -a $iif(?a iswm ba,yes,no) ~ $regex(ba,/^.?a$/)
echo -a $iif(a? iswm ab,yes,no) ~ $regex(ab,/^a.?$/)
echo -a $iif(a? iswm a,yes,no) ~ $regex(a,/^a.?$/)
}As you can see, the wildcard ? does not always match where .? does.
Also, regex is fairly complex. It's almost like a small sub-language which you have to learn. A lot of people looking for basic string manipulation or comparison tools will not want to learn to use regex for simple tasks like this. Regex should be used for advanced string comparison and manipulation like it was intended.
Something as simple as a case-sensitive $read() flag really shouldn't get this much opposition imo, if only for consistency with other identifiers which support case-sensitivity. Seems like a good idea to me!