summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/regex_replace.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-04 23:35:56 +0100
committerGitHub <[email protected]>2023-02-04 23:35:56 +0100
commitadc47cefc2976768c3f0b773bd26bfd1062e8a53 (patch)
tree4923f88afb0d091d5d39ae03d65a4998a0517652 /misc/examples/regex_replace.c
parent0c4c4f8bba17562735b67b2923cd23c773aa53a7 (diff)
parentd2ff84c53aa9bd3857fdf22dcf7cd9398a4780be (diff)
downloadSTC-modified-adc47cefc2976768c3f0b773bd26bfd1062e8a53.tar.gz
STC-modified-adc47cefc2976768c3f0b773bd26bfd1062e8a53.zip
Merge pull request #46 from tylov/newinit
Version 4.1 RC2: signed sizes and indices, cspan with numpy slicing.
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 a170856b..ec38ca56 100644
--- a/misc/examples/regex_replace.c
+++ b/misc/examples/regex_replace.c
@@ -26,15 +26,15 @@ int main()
printf("fixed: %s\n", cstr_str(&str));
/* US date format, and add 10 years to dates: */
- cstr_take(&str, cregex_replace_pattern_ex(pattern, input, "$1/$3/$2", 0, add_10_years, CREG_DEFAULT));
+ cstr_take(&str, cregex_replace_pattern(pattern, input, "$1/$3/$2", 0, add_10_years, CREG_DEFAULT));
printf("us+10: %s\n", cstr_str(&str));
/* Wrap first date inside []: */
- cstr_take(&str, cregex_replace_pattern_ex(pattern, input, "[$0]", 1, NULL, CREG_DEFAULT));
+ cstr_take(&str, cregex_replace_pattern(pattern, input, "[$0]"));
printf("brack: %s\n", cstr_str(&str));
/* Shows how to compile RE separately */
- c_WITH (cregex re = cregex_from(pattern, CREG_DEFAULT), cregex_drop(&re)) {
+ c_WITH (cregex re = cregex_from(pattern), cregex_drop(&re)) {
if (cregex_captures(&re) == 0)
continue; /* break c_WITH */
/* European date format. */