@@ -39,7 +39,7 @@ If you want to use external libraries not installed by project using CPM
3939
4040| Cmake option Name | Description | Default |
4141| :--------------------------| :-----------------------------------------------------------------| :-------:|
42- | ` PCRE2CPP_MSTD_EXTERNAL ` | Uses users own mstd library (tested and compatible with: 1.5.3 ) | OFF |
42+ | ` PCRE2CPP_MSTD_EXTERNAL ` | Uses users own mstd library (tested and compatible with: 1.5.4 ) | OFF |
4343| ` PCRE2CPP_PCRE2_EXTERNAL ` | Uses users own pcre2 library (tested and compatible with: 10.47) | OFF |
4444
4545### Project developing options
@@ -52,6 +52,7 @@ These options are used while testing or changing code in project
5252| ` PCRE2CPP_BUILD_BENCHMARK ` | Build benchmark | ` ${PROJECT_IS_TOP_LEVEL} ` |
5353| ` PCRE2CPP_BUILD_COVERAGE ` | Enable coverage reporting | ` ${PROJECT_IS_TOP_LEVEL} ` |
5454| ` PCRE2CPP_BUILD_DOCUMENTATION ` | Build documentation | ` ${PROJECT_IS_TOP_LEVEL} ` |
55+ | ` PCRE2CPP_BUILD_EXAMPLES ` | Build examples | ` ${PROJECT_IS_TOP_LEVEL} ` |
5556| ` PCRE2CPP_ENABLE_CLANG_TIDY ` | Enables clang-tidy checks | ` ${PROJECT_IS_TOP_LEVEL} ` |
5657| ` PCRE2CPP_INSTALL ` | Enables installation of this project | ` ${PROJECT_IS_TOP_LEVEL} ` |
5758| ` PCRE2CPP_INSTALL_TEST ` | This is only to test if installation of pcre2cpp works | OFF |
@@ -206,11 +207,11 @@ using namespace pcre2cpp;
206207int main () {
207208 regex expression("\\d+");
208209
209- if (expression.match_at("aa2", 3, 2)) { // is true
210+ if (expression.match_at("aa2", 2)) { // is true
210211 cout << "Matches result: 2 at: 2" << endl;
211212 }
212213
213- if (expression.match_at("aa2", 3, 1)) { // is false
214+ if (expression.match_at("aa2", 1)) { // is false
214215 cout << "Matches result: 2 at: 2" << endl;
215216 }
216217
@@ -231,7 +232,7 @@ int main() {
231232 regex expression("\\d+");
232233
233234 match_result result;
234- if (expression.match_at("aa2", 3, result, 2)) { // is true
235+ if (expression.match_at("aa2", result, 2)) { // is true
235236 cout << "Matches result: " << result.get_result_value() << " at: "
236237 << to_string(result.get_result_global_offset()) << endl;
237238
@@ -284,7 +285,7 @@ int main() {
284285 if (expression.match("ab23a", result, 1)) { // is true
285286 cout << "Sub Match <number> result: " << result.get_sub_result_value("number")
286287 << " at: " << result.get_sub_result_global_offset("number")
287- << ", Sub Match 1 result: " << result.get_sub_result_value("a")
288+ << ", Sub Match <a> result: " << result.get_sub_result_value("a")
288289 << " at: " << result.get_sub_result_global_offset("a") << endl;
289290
290291 // Should print: "Sub Match <number> result: 23 at: 2, Sub Match <a> result: a at: 4"
@@ -307,27 +308,14 @@ int main() {
307308 regex expression("\\d+");
308309
309310 std::vector<match_result> results;
310- if (expression.match_all("Ala ma 23 lata i 3 koty", 23, results)) { // is true
311+ if (expression.match_all("Ala ma 23 lata i 3 koty", results)) { // is true
311312 cout << "Match 0 result: " << results[0].get_result_value()
312313 << " at: " << results[0].get_result_global_offset()
313314 << ", Match 1 result: " << results[1].get_result_value()
314315 << " at: " << results[1].get_result_global_offset() << endl;
315316
316317 // Should print: "Match 0 result: 23 at: 7, Match 1 result: 3 at: 17"
317318 }
318-
319- match_result* resultsPtr;
320- size_t resultsCount;
321- if (expression.match_all("Ala ma 23 lata i 3 koty", 23, resultsPtr, resultsCount)) { // is true
322- cout << "Match 0 result: " << resultsPtr[0].get_result_value()
323- << " at: " << resultsPtr[0].get_result_global_offset()
324- << ", Match 1 result: " << resultsPtr[1].get_result_value()
325- << " at: " << resultsPtr[1].get_result_global_offset() << endl;
326-
327- // Should print: "Match 0 result: 23 at: 7, Match 1 result: 3 at: 17"
328-
329- delete[] resultsPtr;
330- }
331319
332320 return 0;
333321}
0 commit comments