public member function
<regex>
template <class ForwardIterator> char_class_type lookup_classname ( ForwardIterator first, ForwardIterator last, bool nocase = false ) const;
Return character class mask
Returns a bitmask value that selects the character class identified by the character sequence between first and last.
The returned value can be used as argument for member function regex_traits::isctype to identify the type of a character.
This function is called when a potential named class name is encountered in a regular expression to obtain the value to be used in subsequent calls to isctype in order to match characters. nocase is set to true if the regex object has icase as a syntax option.
For the char and wchar_t specializations of the standard regex_traits, at least the following names are supported:
name* | class description | equivalent check in default locale |
alnum | alpha-numerical character | isalnum |
alpha | alphabetic character | isalpha |
blank | blank character | isblank |
cntrl | control character | iscntrl |
digit | decimal digit character | isdigit |
graph | character with graphical representation | isgraph |
lower | lowercase letter | islower |
print | printable character | isprint |
punct | punctuation mark character | ispunct |
space | whitespace character | isspace |
upper | uppercase letter | isupper |
xdigit | hexadecimal digit character | isxdigit |
d | decimal digit character | isdigit |
w | word character | isalnum |
s | whitespace character | isspace |
* The name is matched without regard to the case of the characters used in the character sequence.
Parameters
- first, last
- Forward iterators to the initial and final positions in a sequence of characters.
Case insensitive.
The range used is [first,last), which includes all the characters between first and last, including the character pointed by first but not the character pointed by last.
- nocase
- If true, the returned bitmask is suitable to match characters without regard to their case.
Return value
A bitmask value to select the specified character class.
If the character sequence does not name a supported character class, it returns a value that compares equal to 0
.
If the character sequence does not name a supported character class, it returns char_class_type()
.
char_class_type is a member type, defined as a bitmask type used to identify character classes.
A bitmask type may have been implemented in your library either as an enumerated type, an integer type, or a bitset. In any case, it can take one or more flags of that same type as value by combining them using the bitwise OR operator (|).