std::regex_constants::syntax_option_type
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <regex>
|
||
typedef /*unspecified*/ syntax_option_type; static constexpr syntax_option_type icase = /*unspecified*/; |
||
syntax_option_type
ist ein BitmaskType
die Optionen, wie reguläre Ausdrücke verhalten regeln enthält .syntax_option_type
is a BitmaskType
that contains options that govern how regular expressions behave.You can help to correct and verify the translation. Click here for instructions.
icase
, optimize
, etc.) sind im Inneren std :: basic_regex vervielfältigt .You can help to correct and verify the translation. Click here for instructions.
Inhaltsverzeichnis |
[Bearbeiten] Konstanten
Value
Original: Value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Effect(s) |
icase
|
Character matching should be performed without regard to case. |
nosubs
|
When performing matches, no sub-expression matches should be stored in the supplied std::regex_match structure. |
optimize
|
Instructs the regular expression engine to make matching faster, with the potential cost of making construction slower. For example, this might mean converting a non-deterministic FSA to a deterministic FSA. |
collate
|
Character ranges of the form "[a-b]" will be locale sensitive. |
ECMAScript
|
Use the ECMAScript (JavaScript) regular expression grammar (ECMA-262 grammar documentation), modified to support collating elements, character classes, and equivalence classes from POSIX, and the character class aliases \d, \D, \s, \S, \w, and \W are made locale-sensitive |
basic
|
Use the basic POSIX regular expression grammar (grammar documentation). |
extended
|
Use the extended POSIX regular expression grammar (grammar documentation). |
awk
|
Use the regular expression grammar used by the awk utility in POSIX (grammar documentation) |
grep
|
Use the regular expression grammar used by the grep utility in POSIX. This is effectively the same as the basic option with the addition of newline '\n' as an alternation separator.
|
egrep
|
Use the regular expression grammar used by the grep utility, with the -E option, in POSIX. This is effectively the same as the extended option with the addition of newline '\n' as an alternation separator in addtion to '|'.
|
[Bearbeiten] Notes
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
You can help to correct and verify the translation. Click here for instructions.
#include <iostream> #include <string> #include <regex> int main() { std::string str = "zzxayyzz"; std::regex re1(".*(a|xayy)"); // ECMA std::regex re2(".*(a|xayy)", std::regex::extended); // POSIX std::cout << "Searching for .*(a|xayy) in zzxayyzz:\n"; std::smatch m; std::regex_search(str, m, re1); std::cout << " ECMA (depth first search) match: " << m[0] << '\n'; std::regex_search(str, m, re2); std::cout << " POSIX (leftmost longest) match: " << m[0] << '\n'; }
Output:
Searching for .*(a|xayy) in zzxayyzz: ECMA (depth first search) match: zzxa POSIX (leftmost longest) match: zzxayy
[Bearbeiten] Siehe auch
(C++11) |
regulären Ausdrucks Original: regular expression object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Klassen-Template) |