A scan set is a group of characters that make up a set and are interpreted as valid characters in the input. A scan set is specified in the format string by the %[ and ] characters; any characters within the square brackets make up the scan set. The scan set may indicate that either the characters should be included in the input or the characters should be excluded. A circumflex (^) used as the first character indicates negation of the set and indicates all characters except those specified. Consider the following scan sets:
Scan set | Description |
%[aeiouy] | Any of the specified six characters—a, e, i, o, u, and y—are valid input. |
%[^aeiouy] ... |