Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::regex_traits

      From cppreference.com
      <cpp‎ |regex
       
       
       
      Regular expressions library
      Classes
      (C++11)
      Algorithms
      Iterators
      Exceptions
      Traits
      regex_traits
      (C++11)
      Constants
      (C++11)
      Regex Grammar
       
       
      Defined in header<regex>
      template<class CharT>
      class regex_traits;
      (since C++11)

      The type trait templateregex_traits suppliesstd::basic_regex with the set of types and functions necessary to operate on the typeCharT.

      Since many of regex operations are locale-sensitive (whenstd::regex_constants::collate flag is set), the regex_traits class typically holds an instance of astd::locale as a private member.

      [edit]Standard specializations

      Two specializations ofstd::regex_traits are defined by the standard library:

      std::regex_traits<char>
      std::regex_traits<wchar_t>

      These specializations make it possible to usestd::basic_regex<char> (akastd::regex) andstd::basic_regex<wchar_t> (akastd::wregex). To usestd::basic_regex with other character types (for example,char32_t), a user-provided trait class must be used.

      [edit]Member types

      Type Definition
      char_typeCharT
      string_typestd::basic_string<CharT>
      locale_type The locale used for localized behavior in the regular expression. Must beCopyConstructible
      char_class_type Represents a character classification and is capable of holding an implementation specific set returned bylookup_classname. Must be aBitmaskType.

      [edit]Member functions

      constructs the regex_traits object
      (public member function)[edit]
      [static]
      calculates the length of a null-terminated character string
      (public static member function)[edit]
      determines the equivalence key for a character
      (public member function)[edit]
      determines the case-insensitive equivalence key for a character
      (public member function)[edit]
      determines the sort key for the given string, used to provide collation order
      (public member function)[edit]
      determines the primary sort key for the character sequence, used to determine equivalence class
      (public member function)[edit]
      gets a collation element by name
      (public member function)[edit]
      gets a character class by name
      (public member function)[edit]
      indicates membership in a localized character class
      (public member function)[edit]
      translates the character representing a numeric digit into an integral value
      (public member function)[edit]
      sets the locale
      (public member function)[edit]
      gets the locale
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/regex_traits&oldid=167158"

      [8]ページ先頭

      ©2009-2025 Movatter.jp