summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/regex_replace.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/regex_replace.c b/examples/regex_replace.c
index 1216701f..2383a119 100644
--- a/examples/regex_replace.c
+++ b/examples/regex_replace.c
@@ -17,7 +17,6 @@ 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 (cregex, re)
c_auto (cstr, str1, str2)
{
printf("input: %s\n", input);
@@ -26,7 +25,7 @@ int main()
printf("euros: %s\n", cstr_str(&str1));
/* US date format, and subtract 20 years: */
- str2 = cregex_replace_fn(input, pattern, "\\1/\\3/\\2", sub_20y, 0, 0);
+ str2 = cregex_replace_ex(input, pattern, "\\1/\\3/\\2", sub_20y, 0, 0);
printf("us-20: %s\n", cstr_str(&str2));
}
}