
- C++ Library - Home
- C++ Library - <fstream>
- C++ Library - <iomanip>
- C++ Library - <ios>
- C++ Library - <iosfwd>
- C++ Library - <iostream>
- C++ Library - <istream>
- C++ Library - <ostream>
- C++ Library - <sstream>
- C++ Library - <streambuf>
- C++ Library - <atomic>
- C++ Library - <complex>
- C++ Library - <exception>
- C++ Library - <functional>
- C++ Library - <limits>
- C++ Library - <locale>
- C++ Library - <memory>
- C++ Library - <new>
- C++ Library - <numeric>
- C++ Library - <regex>
- C++ Library - <stdexcept>
- C++ Library - <string>
- C++ Library - <thread>
- C++ Library - <tuple>
- C++ Library - <typeinfo>
- C++ Library - <utility>
- C++ Library - <valarray>
- The C++ STL Library
- C++ Library - <array>
- C++ Library - <bitset>
- C++ Library - <deque>
- C++ Library - <forward_list>
- C++ Library - <list>
- C++ Library - <map>
- C++ Library - <multimap>
- C++ Library - <queue>
- C++ Library - <priority_queue>
- C++ Library - <set>
- C++ Library - <stack>
- C++ Library - <unordered_map>
- C++ Library - <unordered_set>
- C++ Library - <vector>
- C++ Library - <algorithm>
- C++ Library - <iterator>
- The C++ Advanced Library
- C++ Library - <any>
- C++ Library - <barrier>
- C++ Library - <bit>
- C++ Library - <chrono>
- C++ Library - <cinttypes>
- C++ Library - <clocale>
- C++ Library - <condition_variable>
- C++ Library - <coroutine>
- C++ Library - <cstdlib>
- C++ Library - <cstring>
- C++ Library - <cuchar>
- C++ Library - <charconv>
- C++ Library - <cfenv>
- C++ Library - <cmath>
- C++ Library - <ccomplex>
- C++ Library - <expected>
- C++ Library - <format>
- C++ Library - <future>
- C++ Library - <flat_set>
- C++ Library - <flat_map>
- C++ Library - <filesystem>
- C++ Library - <generator>
- C++ Library - <initializer_list>
- C++ Library - <latch>
- C++ Library - <memory_resource>
- C++ Library - <mutex>
- C++ Library - <mdspan>
- C++ Library - <optional>
- C++ Library - <print>
- C++ Library - <ratio>
- C++ Library - <scoped_allocator>
- C++ Library - <semaphore>
- C++ Library - <source_location>
- C++ Library - <span>
- C++ Library - <spanstream>
- C++ Library - <stacktrace>
- C++ Library - <stop_token>
- C++ Library - <syncstream>
- C++ Library - <system_error>
- C++ Library - <string_view>
- C++ Library - <stdatomic>
- C++ Library - <variant>
- C++ STL Library Cheat Sheet
- C++ STL - Cheat Sheet
- C++ Programming Resources
- C++ Programming Tutorial
- C++ Useful Resources
- C++ Discussion
C++ Regex Library - regex_constants
Description
It is a regex constants.
The types of regex constants should be as shown below −
Bitmask type error_type
It is used in the regex_error to identify the kind of error that threw the exception.
flag | effects on syntax | notes |
---|---|---|
icase | Case insensitive | Regular expressions match without regard to case. |
nosubs | No sub-expressions | The match_results structure will not contain sub-expression matches. |
optimize | Optimize matching | Matching efficiency is preferred over efficiency constructing regex objects. |
collate | Locale sensitiveness | Character ranges, like "[a-b]", are affected by locale. |
ECMAScript | ECMAScript grammar |
The regular expression follows one of these grammars. One (and only one) of these six grammar flags needs to be set for the bitmask to have a valid value. |
basic | Basic POSIX grammar | |
extended | Extended POSIX grammar | |
awk | Awk POSIX grammar | |
grep | Grep POSIX grammar | |
egrep | Egrep POSIX grammar |
Bitmask type syntax_option_type
it is used in the construction or assignment of regex objects to specify the syntax used by the object.
C++11
flag | effects on syntax | notes |
---|---|---|
icase | Case insensitive | Regular expressions match without regard to case. |
nosubs | No sub-expressions | The match_results structure will not contain sub-expression matches. |
optimize | Optimize matching | Matching efficiency is preferred over efficiency constructing regex objects. |
collate | Locale sensitiveness | Character ranges, like "[a-b]", are affected by locale. |
ECMAScript | ECMAScript grammar |
The regular expression follows one of these grammars. One (and only one) of these six grammar flags needs to be set for the bitmask to have a valid value. |
basic | Basic POSIX grammar | |
extended | Extended POSIX grammar | |
awk | Awk POSIX grammar | |
grep | Grep POSIX grammar | |
egrep | Egrep POSIX grammar |
C++14
flag | effects on syntax | notes |
---|---|---|
icase | Case insensitive | Regular expressions match without regard to case. |
nosubs | No sub-expressions |
Sub-expressions are not considered to be marked. The match_results structure will not contain sub-expression matches. |
optimize | Optimize matching | Matching efficiency is preferred over efficiency constructing regex objects. |
collate | Locale sensitiveness | Character ranges, like "[a-b]", are affected by locale. |
ECMAScript | ECMAScript grammar |
The regular expression follows one of these grammars. At most one of these six grammar flags can be set for the bitmask to have a valid value. If none is set, ECMAScript is assumed. |
basic | Basic POSIX grammar | |
extended | Extended POSIX grammar | |
awk | Awk POSIX grammar | |
grep | Grep POSIX grammar | |
egrep | Egrep POSIX grammar |
Bitmask type match_flag_type
It is used as a parameter to functions regex_match, regex_search and regex_replace and also as a parameter to the constructors of regex_iterator and regex_token_iterator.
flag | effects | notes |
---|---|---|
match_default | Default | Default matching behavior.**. |
match_not_bol | Not Beginning-Of-Line | The first character is not considered a beginning of line ("^" does not match). |
match_not_eol | Not End-Of-Line | The last character is not considered an end of line ("$" does not match). |
match_not_bow | Not Beginning-Of-Word | The escape sequence "\b" does not match as a beginning-of-word. |
match_not_eow | Not End-Of-Word | The escape sequence "\b" does not match as an end-of-word. |
match_any | Any match | Any match is acceptable if more than one match is possible. |
match_not_null | Not null | Empty sequences do not match. |
match_continuous | Continuous |
The expression must match a sub-sequence that begins at the first character. Sub-sequences must begin at the first character to match. |
match_prev_avail | Previous Available | One or more characters exist before the first one. (match_not_bol and match_not_bow are ignored) |
format_default | Default formatting | Uses the standard formatting rules to replace matches (those used by ECMAScript's replace method).**. |
format_sed | sed formatting | Uses the same rules as the sed utility in POSIX to replace matches. |
format_no_copy | No copy | The sections in the target sequence that do not match the regular expression are not copied when replacing matches. |
format_first_only | First only | Only the first occurrence of a regular expression is replaced. |