• L' Eomot Inversé (11/22/2013)


    Bad question because the words you were wrote don't necessarily mean what you apparently think they do. Or was it intentionally a trick question?

    Mind you, it's not as bad as Tuesday's question, which is unambiguously wrong and ought to be corrected (there are only about a dozen comments so far; they all say it's wrong;

    which of these wildcard characters should be followed by a list of wildcard characters; but the list contains &, which isn't a wildcard character, {} which isn't a wild card character (it's two characters), and [] which isn't a wild card character (it too is two characters). You might want to say that you didnt mean a list of single wildcard characters, but if you mant a list of strings of wildcard characters then the presence of {} and & means the list doesn't match the question; doesn't match anything at all makes the answer wrong. So we are left guessing what you mean. I guessed you meant strings of characters, since you gave a list of strings and not a list of characters or a list of wildcard strings. And the string [] can't match a single character - indeed it can't match anything at all unless preceeded by an escape character and then it matches 2 characters.

    [] can't match a single character: s like '[]' is always false (unless s is null, in which case it's unknown).

    {} can't natch a single character, it always matches two.

    _ matches any single character, and can only match a single character.

    & matches a particular single character (itself), and can't match anything else.

    % matches any single character, but also matches any string.

    So there are three strings which can match a single character; but only two strings are to be selected; two of them can only match a single character, the third can match other things as well, so the choice is obvious: the right answer is _ and &.

    the question sounds pretty clear to me..