Beside the default ECMAScript grammar, the C++ standard library provides support for five other grammars, which you can specify by using the corresponding regex constants (see Section 14.6, page 732). So, you can choose from the following:
• ECMAScript: the default ECMAScript grammar
• basic: the basic regular expression (BRE) grammar of POSIX
• extended: the extended regular expression (ERE) grammar of POSIX
• awk: the grammar of the UNIX tool awk
• grep: the grammar of the UNIX tool grep
• egrep: the grammar of the UNIX tool egrep
Table 14.5 lists the major differences among those grammars. As you can see, the ECMAScript grammar is by far the most powerful one. The only feature it doesn’t support is the use of newline characters to separate multiple patterns with “or,” as grep and egrep provide, and the ability of awk to specify octal escape sequences.