@@ -20,6 +20,35 @@ ctre::match<"REGEX">(subject); // C++20
20
20
* ` std::string ` -like object (` std::string_view ` or your own string if it's providing ` begin ` /` end ` functions with forward iterators)
21
21
* pair of forward iterators
22
22
23
+ ## Supported compilers
24
+
25
+ * clang 5.0+ (template UDL, C++17 syntax)
26
+ * gcc 7.2+ (template UDL, C++17 syntax)
27
+ * gcc 9.0+ (C++17 & C++20 cNTTP syntax)
28
+ * MSVC 15.8.8+ (C++17 syntax only)
29
+
30
+ #### Template UDL syntax
31
+
32
+ Compiler must support N3599 extension (as GNU extension in gcc and clang).
33
+
34
+ #### C++17 syntax
35
+
36
+ You can provide pattern as a ` constexpr ctll::basic_fixed_string ` variable.
37
+
38
+ ``` c++
39
+ static constexpr auto pattern = ctll::basic_fixed_string{ "h.* " };
40
+
41
+ constexpr auto match(std::string_view sv) noexcept {
42
+ return ctre::re<pattern >().match(sv);
43
+ }
44
+ ```
45
+
46
+ (this is tested in MSVC 15.8.8)
47
+
48
+ #### C++20 syntax
49
+
50
+ Currently only compiler which supports cNTTP syntax ` ctre::match<PATTERN>(subject) ` is GCC 9+.
51
+
23
52
## Examples
24
53
25
54
#### Extracting number from input
@@ -94,25 +123,3 @@ for (auto match: ctre::range(input,"[0-9]++"_ctre)) {
94
123
std::cout << std::string_view{match} << "\n";
95
124
}
96
125
```
97
-
98
- ## Supported compilers
99
-
100
- * clang 5.0+
101
- * gcc 7.2+
102
- * MSVC 15.8.8+ (experimental, without string_literal support)
103
-
104
- Compiler must support N3599 extension (as GNU extension in gcc and clang) or C++20 class NTTP (P0732).
105
-
106
- ### MSVC
107
-
108
- Because current MSVC doesn't support custom templated string literals or NTTP, you need to use workaround:
109
-
110
- ``` c++
111
- static constexpr inline auto pattern = ctll::basic_fixed_string{ "h.* " };
112
-
113
- constexpr auto match(std::string_view sv) noexcept {
114
- return ctre::re<pattern >().match(sv);
115
- }
116
- ```
117
-
118
- (this is tested in MSVC 15.8.8 )
0 commit comments