From 0c7e627aa27ba42b9a9a4472a4f1cdf857c1a833 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 26 Jan 2023 10:02:06 +0100 Subject: Removed cregex args in examples which are now defaulted. --- misc/examples/regex1.c | 2 +- misc/examples/regex2.c | 2 +- misc/examples/regex_match.c | 2 +- misc/examples/splitstr.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/examples/regex1.c b/misc/examples/regex1.c index 9552db62..ae00b71c 100644 --- a/misc/examples/regex1.c +++ b/misc/examples/regex1.c @@ -10,7 +10,7 @@ int main(int argc, char* argv[]) c_AUTO (cstr, input) c_AUTO (cregex, float_expr) { - int res = cregex_compile(&float_expr, "^[+-]?[0-9]+((\\.[0-9]*)?|\\.[0-9]+)$", CREG_DEFAULT); + int res = cregex_compile(&float_expr, "^[+-]?[0-9]+((\\.[0-9]*)?|\\.[0-9]+)$"); // Until "q" is given, ask for another number if (res > 0) while (true) { diff --git a/misc/examples/regex2.c b/misc/examples/regex2.c index e24cce51..2b742529 100644 --- a/misc/examples/regex2.c +++ b/misc/examples/regex2.c @@ -18,7 +18,7 @@ int main() c_AUTO (cregex, re) c_FORRANGE (i, c_ARRAYLEN(s)) { - int res = cregex_compile(&re, s[i].pattern, CREG_DEFAULT); + int res = cregex_compile(&re, s[i].pattern); if (res < 0) { printf("error in regex pattern: %d\n", res); continue; diff --git a/misc/examples/regex_match.c b/misc/examples/regex_match.c index b6bd6521..93b83651 100644 --- a/misc/examples/regex_match.c +++ b/misc/examples/regex_match.c @@ -17,7 +17,7 @@ int main() c_AUTO (cstr, nums) { const char* pattern = "[+-]?([0-9]*\\.)?\\d+([Ee][+-]?\\d+)?"; - int res = cregex_compile(&re, pattern, CREG_DEFAULT); + int res = cregex_compile(&re, pattern); printf("%d: %s\n", res, pattern); // extract and convert all numbers in str to floats diff --git a/misc/examples/splitstr.c b/misc/examples/splitstr.c index 70d1935e..ba927412 100644 --- a/misc/examples/splitstr.c +++ b/misc/examples/splitstr.c @@ -13,7 +13,7 @@ int main() puts("\nSplit with c_FORMATCH (regex):"); - c_WITH (cregex re = cregex_from("[^ ]+", CREG_DEFAULT), cregex_drop(&re)) + c_WITH (cregex re = cregex_from("[^ ]+"), cregex_drop(&re)) c_FORMATCH (i, &re, " Hello World C99! ") printf("'%.*s'\n", c_ARGSV(i.match[0])); } -- cgit v1.2.3