C++11標準の正規表現ライブラリでは6種類の正規表現文法をサポートする。既定値はECMAScript(+一部変更)となっている。
N3337 28.5.1/p1より引用。
The type
syntax_option_type
is an implementation-defined bitmask type (17.5.2.1.3). Setting its elements has the effects listed in table 138. A valid value of typesyntax_option_type
shall have exactly one of the elementsECMAScript
,basic
,extended
,awk
,grep
,egrep
, set.
ECMAScript | ECMAScript*1(いわゆるJavaScript)の正規表現+一部変更 |
basic | 基本POSIX正規表現*2 |
extended | 拡張POSIX正規表現*3 |
awk | awkコマンドの正規表現*4 |
grep | grepコマンドの正規表現*5 |
egrep | grep -Eコマンドの正規表現*6 |
関連URL
- 本の虫: C++0x本:正規表現を解説すべきか
- c++ - Why does C++11 support 6 different regular expression grammars? - Stack Overflow
- N1429 A Proposal to add Regular Expressions to the Standard Library
*1:(PDF)Ecma International, ECMAScript Language Specification, Standard Ecma-262, third edition, 1999.(N3337 1.2/p1, p5)
*2:POSIX Base Definitions and Headers, Section 9, Regular Expressions
*3:POSIX Base Definitions and Headers, Section 9, Regular Expressions
*4:awk - pattern scanning and processing language