tmp/tmp2wxj4uji/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### General <a id="re.regex.general">[[re.regex.general]]</a>
|
| 2 |
+
|
| 3 |
+
For a char-like type `charT`, specializations of class template
|
| 4 |
+
`basic_regex` represent regular expressions constructed from character
|
| 5 |
+
sequences of `charT` characters. In the rest of [[re.regex]], `charT`
|
| 6 |
+
denotes a given char-like type. Storage for a regular expression is
|
| 7 |
+
allocated and freed as necessary by the member functions of class
|
| 8 |
+
`basic_regex`.
|
| 9 |
+
|
| 10 |
+
Objects of type specialization of `basic_regex` are responsible for
|
| 11 |
+
converting the sequence of `charT` objects to an internal
|
| 12 |
+
representation. It is not specified what form this representation takes,
|
| 13 |
+
nor how it is accessed by algorithms that operate on regular
|
| 14 |
+
expressions.
|
| 15 |
+
|
| 16 |
+
[*Note 1*: Implementations will typically declare some function
|
| 17 |
+
templates as friends of `basic_regex` to achieve this. — *end note*]
|
| 18 |
+
|
| 19 |
+
The functions described in [[re.regex]] report errors by throwing
|
| 20 |
+
exceptions of type `regex_error`.
|
| 21 |
+
|
| 22 |
+
``` cpp
|
| 23 |
+
namespace std {
|
| 24 |
+
template<class charT, class traits = regex_traits<charT>>
|
| 25 |
+
class basic_regex {
|
| 26 |
+
public:
|
| 27 |
+
// types
|
| 28 |
+
using value_type = charT;
|
| 29 |
+
using traits_type = traits;
|
| 30 |
+
using string_type = typename traits::string_type;
|
| 31 |
+
using flag_type = regex_constants::syntax_option_type;
|
| 32 |
+
using locale_type = typename traits::locale_type;
|
| 33 |
+
|
| 34 |
+
// [re.synopt], constants
|
| 35 |
+
static constexpr flag_type icase = regex_constants::icase;
|
| 36 |
+
static constexpr flag_type nosubs = regex_constants::nosubs;
|
| 37 |
+
static constexpr flag_type optimize = regex_constants::optimize;
|
| 38 |
+
static constexpr flag_type collate = regex_constants::collate;
|
| 39 |
+
static constexpr flag_type ECMAScript = regex_constants::ECMAScript;
|
| 40 |
+
static constexpr flag_type basic = regex_constants::basic;
|
| 41 |
+
static constexpr flag_type extended = regex_constants::extended;
|
| 42 |
+
static constexpr flag_type awk = regex_constants::awk;
|
| 43 |
+
static constexpr flag_type grep = regex_constants::grep;
|
| 44 |
+
static constexpr flag_type egrep = regex_constants::egrep;
|
| 45 |
+
static constexpr flag_type multiline = regex_constants::multiline;
|
| 46 |
+
|
| 47 |
+
// [re.regex.construct], construct/copy/destroy
|
| 48 |
+
basic_regex();
|
| 49 |
+
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
|
| 50 |
+
basic_regex(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
|
| 51 |
+
basic_regex(const basic_regex&);
|
| 52 |
+
basic_regex(basic_regex&&) noexcept;
|
| 53 |
+
template<class ST, class SA>
|
| 54 |
+
explicit basic_regex(const basic_string<charT, ST, SA>& s,
|
| 55 |
+
flag_type f = regex_constants::ECMAScript);
|
| 56 |
+
template<class ForwardIterator>
|
| 57 |
+
basic_regex(ForwardIterator first, ForwardIterator last,
|
| 58 |
+
flag_type f = regex_constants::ECMAScript);
|
| 59 |
+
basic_regex(initializer_list<charT> il, flag_type f = regex_constants::ECMAScript);
|
| 60 |
+
|
| 61 |
+
~basic_regex();
|
| 62 |
+
|
| 63 |
+
// [re.regex.assign], assign
|
| 64 |
+
basic_regex& operator=(const basic_regex& e);
|
| 65 |
+
basic_regex& operator=(basic_regex&& e) noexcept;
|
| 66 |
+
basic_regex& operator=(const charT* p);
|
| 67 |
+
basic_regex& operator=(initializer_list<charT> il);
|
| 68 |
+
template<class ST, class SA>
|
| 69 |
+
basic_regex& operator=(const basic_string<charT, ST, SA>& s);
|
| 70 |
+
|
| 71 |
+
basic_regex& assign(const basic_regex& e);
|
| 72 |
+
basic_regex& assign(basic_regex&& e) noexcept;
|
| 73 |
+
basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
|
| 74 |
+
basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
|
| 75 |
+
template<class ST, class SA>
|
| 76 |
+
basic_regex& assign(const basic_string<charT, ST, SA>& s,
|
| 77 |
+
flag_type f = regex_constants::ECMAScript);
|
| 78 |
+
template<class InputIterator>
|
| 79 |
+
basic_regex& assign(InputIterator first, InputIterator last,
|
| 80 |
+
flag_type f = regex_constants::ECMAScript);
|
| 81 |
+
basic_regex& assign(initializer_list<charT>,
|
| 82 |
+
flag_type f = regex_constants::ECMAScript);
|
| 83 |
+
|
| 84 |
+
// [re.regex.operations], const operations
|
| 85 |
+
unsigned mark_count() const;
|
| 86 |
+
flag_type flags() const;
|
| 87 |
+
|
| 88 |
+
// [re.regex.locale], locale
|
| 89 |
+
locale_type imbue(locale_type loc);
|
| 90 |
+
locale_type getloc() const;
|
| 91 |
+
|
| 92 |
+
// [re.regex.swap], swap
|
| 93 |
+
void swap(basic_regex&);
|
| 94 |
+
};
|
| 95 |
+
|
| 96 |
+
template<class ForwardIterator>
|
| 97 |
+
basic_regex(ForwardIterator, ForwardIterator,
|
| 98 |
+
regex_constants::syntax_option_type = regex_constants::ECMAScript)
|
| 99 |
+
-> basic_regex<typename iterator_traits<ForwardIterator>::value_type>;
|
| 100 |
+
}
|
| 101 |
+
```
|
| 102 |
+
|