• Steve Jones - SSC Editor (11/22/2013)


    Tom,

    You're being pedantic here in terms of the question. The question isn't which of these are single characters, which which wildcards match.

    Yes, I'm probably being pedantic. But I suspect anyone else with a postgrad degree in mathematical logic would have picked the answere _ and &, just as I did.

    "&" isn't a wildcard, therefore it doesn't count.

    You are the one who included {} and & in what you called "the following wildcard characters", not me. And show me the single character that is matched by []? I can't imagine <string> LIKE '[]' ever returning TRUE, or <string1> LIKE <string2>[]<string3> if you want a bigger pattern containing your "wildcard".

    % doesn't match single characters, it matches multiple characters. There could be a reasonable argument here that if the data contains a single character, this matches, but in general, this isn't designed to, nor is code written with this to, match a single character. I'll reword the question to remove this.

    Well, it's quite clear that it can match a single character but as I said, that one doesn't matter because it can match multiple chracters so most peole won't count it. But it's probably just as well to reword to avoid that one. So I guess we agree on that part of it.

    You are treating these as literals, not as the wildcard characters.

    I'm treating them as things that can occur in a string which is used as a pattern. I can't treat your list of wildcard characters as wildcard characters because two of your list ({} and &) have nothing to do with wildcards, so I have to assume they are just things that might occur in a pattern. _ is a pattern component that matches a single character. So are most other single characters, including &.

    But I don't think the question needs changing - the results look as if most people understood it the way you intended it. I just want to persuade you to be more careful with wording in future.

    Tom