summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/regex_replace.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/regex_replace.c
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/examples/regex_replace.c')
-rw-r--r--misc/examples/regex_replace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/regex_replace.c b/misc/examples/regex_replace.c
index ec38ca56..ebb57488 100644
--- a/misc/examples/regex_replace.c
+++ b/misc/examples/regex_replace.c
@@ -17,7 +17,7 @@ int main()
const char* pattern = "\\b(\\d\\d\\d\\d)-(1[0-2]|0[1-9])-(3[01]|[12][0-9]|0[1-9])\\b";
const char* input = "start date: 2015-12-31, end date: 2022-02-28";
- c_AUTO (cstr, str)
+ c_auto (cstr, str)
{
printf("INPUT: %s\n", input);
@@ -34,9 +34,9 @@ int main()
printf("brack: %s\n", cstr_str(&str));
/* Shows how to compile RE separately */
- c_WITH (cregex re = cregex_from(pattern), cregex_drop(&re)) {
+ c_with (cregex re = cregex_from(pattern), cregex_drop(&re)) {
if (cregex_captures(&re) == 0)
- continue; /* break c_WITH */
+ continue; /* break c_with */
/* European date format. */
cstr_take(&str, cregex_replace(&re, input, "$3.$2.$1"));
printf("euros: %s\n", cstr_str(&str));