summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-09 08:56:41 +0200
committerTyge Løvset <[email protected]>2022-08-09 08:56:41 +0200
commitfb7ca13856348182b4071135cce82075f9b95e6d (patch)
treec4ed4c905c68faacae22703e121c27f5cc7673bd /examples
parent2df3fb58bb21be5afcfa78fd0b5d1aee033ebe9e (diff)
downloadSTC-modified-fb7ca13856348182b4071135cce82075f9b95e6d.tar.gz
STC-modified-fb7ca13856348182b4071135cce82075f9b95e6d.zip
Small API change for V4.0:
Renamed cregex_find_p() => cregex_find_pt() // pattern Renamed cregex_replace_p() => cregex_replace_pt() // pattern
Diffstat (limited to 'examples')
-rw-r--r--examples/regex_replace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/regex_replace.c b/examples/regex_replace.c
index eba31491..1b140676 100644
--- a/examples/regex_replace.c
+++ b/examples/regex_replace.c
@@ -22,7 +22,7 @@ int main()
printf("INPUT: %s\n", input);
/* replace with a fixed string, extended all-in-one call: */
- cstr_take(&str, cregex_replace_p(input, pattern, "YYYY-MM-DD", 0));
+ cstr_take(&str, cregex_replace_pt(input, pattern, "YYYY-MM-DD", 0));
printf("fixed: %s\n", cstr_str(&str));
/* US date format, and add 10 years to dates: */
@@ -30,7 +30,7 @@ int main()
printf("us+10: %s\n", cstr_str(&str));
/* Wrap first date inside []: */
- cstr_take(&str, cregex_replace_p(input, pattern, "[$0]", 1));
+ cstr_take(&str, cregex_replace_pt(input, pattern, "[$0]", 1));
printf("brack: %s\n", cstr_str(&str));
/* Shows how to compile RE separately */
@@ -47,7 +47,7 @@ int main()
}
/* Wrap all words in ${} */
- cstr_take(&str, cregex_replace_p("[52] apples and [31] mangoes", "[a-z]+", "$${$0}", 0));
+ cstr_take(&str, cregex_replace_pt("[52] apples and [31] mangoes", "[a-z]+", "$${$0}", 0));
printf("curly: %s\n", cstr_str(&str));
}
}