Showing content from https://cplusplus.com/reference/regex/regex_traits/ below:
class template
<regex>
std::regex_traits
template <class charT> class regex_traits;
Regex traits
Regex traits classes specify some of the semantics for regular expressions.
Every basic_regex object uses the member functions provided by its regex traits class to perform some of its most basic tasks.
regex_traits is a class template used as default regex traits by standard basic_regex objects.
[Note: regex_traits refers to the name of a class template defined in header <regex>, while regex traits (no underscore) refers generically to a certain kind of classes. This page makes reference to both.]
An instantitation of basic_regex other that regex can use a different class as regex traits class to customize the behavior of the basic_regex object.
A custom regex traits does not need to have the standard regex_traits class template as a base class, but it shall define the same members and respect its required semantics.
The reference in these pages includes in its description both the behavior of the standard regex_traits class and the required behavior for other classes that intend to be used as regex traits classes.
Template parameters
-
charT
-
The character type.
Strings used with the basic_regex object are sequences of characters of this type.
Member types The following aliases are member types of regex_traits. Any custom regex traits is expected to have these same member types defined:
member type requirement for regex traits classes definition in regex_traits char_type the character type (the same as the one used in the basic_regex object) the first template parameter (charT) string_type basic_string<char_type> (see string) basic_string<charT> locale_type a copy-constructible locale type the standard locale type char_class_type a bitmask type suitable as return type of member lookup_classname a bitmask type
Member functions
-
(constructor)
-
Construct regex_traits (public member function)
-
length
-
Return length of string (public member function)
-
translate
-
Translate character (public member function)
-
translate_nocase
-
Translate character (case insensitive) (public member function)
-
transform
-
Transform to string (public member function)
-
transform_primary
-
Transform string to primary sort key (public member function)
-
lookup_collatename
-
Return collate name equivalent (public member function)
-
lookup_classname
-
Return character class mask (public member function)
-
isctype
-
Check if character is of a class type (public member function)
-
value
-
Value of a digit character (public member function)
-
imbue
-
Imbue locale (public member function)
-
getloc
-
Get locale (public member function)
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4