

For example, matches any character other than " a", " b", or " c", and matches any single character that is not a lowercase letter from " a" to " z". Matches a single character that is not contained within the brackets.

The bracket expression may also contain character classes, equivalence classes, and collating characters. The ] character can be included in a bracket expression if it is the first character: abc]. The - character is treated as a literal character if it is the last or the first character within the brackets. These forms can be mixed: matches " a", " b", " c", " x", " y", or " z", as does. For example, matches " a", " b", or " c", and specifies a range which matches any lowercase letter from " a" to " z". Matches a single character that is contained within the brackets. For example, a.c matches " abc", etc., but matches only " a", ". Within POSIX bracket expressions, the dot character matches a literal dot. Matches any single character (many applications exclude newlines, and exactly which characters are considered newlines is flavor, character encoding, and platform specific, but it is safe to assume that the line feed character is included). The exceptions, listed below, are called metacharacters or metasequences. In POSIX Basic Regular Expression syntax, most characters are treated as literals - they match only themselves (e.g., a matches " a").


These standards were designed mostly to provide backward compatibility with the traditional Simple Regular Expressions syntax, providing a common standard which has since been adopted as the default syntax of many Unix regular expression tools. The POSIX Basic Regular Expressions syntax was developed by the IEEE, together with an extended variant called Extended Regular Expression syntax. Traditional Unix regular expression syntax followed common conventions that often differed from tool to tool.
