You can also include character ranges in a char-set, by writing the first and the last characters of the range separated by a hyphen. You will seldom need this facility, because most useful ranges are already predefined; for instance, '[0-9]' is simpler when written as '%d', '[0-9a-fA-F]' is the same as '%x'. However, if you need to find an octal digit, then you may prefer '[0-7]', instead of an explicit enumeration ('[01234567]'). You can get the complement of a char-set by starting it with `^´: '[^0-7]' finds any character that is not an octal digit and '[^
]' matches any character different from newline. But remember that you can negate simple classes with its upper case version: '%S' is simpler than '[^%s]'.
Character classes follow the current locale set for Lua. Therefore, the class '[a-z]' can be different from '%l'. In a proper locale, the latter form includes letters such as `ç´ and `ã´. You should always use the latter form, unless you have a strong reason to do otherwise: It is simpler, more portable, and slightly more efficient.