Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_regex<CharT,Traits>::assign

      From cppreference.com
      <cpp‎ |regex‎ |basic regex
       
       
       
      Regular expressions library
      Classes
      (C++11)
      Algorithms
      Iterators
      Exceptions
      Traits
      Constants
      (C++11)
      Regex Grammar
       
       
      basic_regex& assign(const basic_regex& other);
      (1)(since C++11)
      basic_regex& assign( basic_regex&& other)noexcept;
      (2)(since C++11)
      basic_regex& assign(const CharT* s,
                           flag_type f=std::regex_constants::ECMAScript);
      (3)(since C++11)
      basic_regex& assign(const CharT* ptr,std::size_t count,
                           flag_type f=std::regex_constants::ECMAScript);
      (4)(since C++11)
      template<class ST,class SA>

      basic_regex& assign(conststd::basic_string<CharT,ST,SA>& str,

                           flag_type f=std::regex_constants::ECMAScript);
      (5)(since C++11)
      template<class InputIt>

      basic_regex& assign( InputIt first, InputIt last,

                           flag_type f=std::regex_constants::ECMAScript);
      (6)(since C++11)
      basic_regex& assign(std::initializer_list<CharT> ilist,
                           flag_type f=std::regex_constants::ECMAScript);
      (7)(since C++11)

      Assigns the contents to the regular expression.

      1) Assigns the contents ofother.flags() andmark_count() are equivalent to the values ofother.flags() andother.mark_count() after the call.
      2) Assigns the contents ofother using move semantics.flags() andmark_count() are equivalent to the values ofother.flags() andother.mark_count() before the assignment. After the call,other is in a valid, but unspecified state.
      3-7) Assigns a sequence of characters to the regular expression. The syntax flags are set tof.mark_count() returns the number of marked subexpressions within the resulting subexpression after the call.
      3) Assigns a null-terminated string pointed to bys.
      4) Assigns a sequence ofcount characters, pointed to bys.
      5) Assigns the stringstr.
      6) Assigns the characters in the range[firstlast).
      7) Assigns the characters in the initializer listilist.

      Contents

      [edit]Parameters

      other - another regular expression to assign
      s - pointer to a character sequence to assign
      str - string to assign
      first, last - the range of characters to assign
      ilist - initializer list containing characters to assign
      Type requirements
      -
      InputIt must meet the requirements ofLegacyInputIterator.

      [edit]Return value

      *this

      [edit]Exceptions

      1) May throw implementation-defined exceptions.
      3-7)std::regex_error if the supplied regular expression is not valid. The object is not modified in that case.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      assigns the contents
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/basic_regex/assign&oldid=160993"

      [8]ページ先頭

      ©2009-2025 Movatter.jp