summaryrefslogtreecommitdiffhomepage
path: root/include/stc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-07-22 17:44:27 +0200
committerTyge Løvset <[email protected]>2022-07-22 17:44:27 +0200
commitc1ecb1ac75664b0771993582fda9919e52d03a2d (patch)
tree8206cc820313f1f1f8ae450111268e6de6811cb4 /include/stc
parent29d9d1d96d8a37f6d7e24dc170aa08a40f0f1559 (diff)
downloadSTC-modified-c1ecb1ac75664b0771993582fda9919e52d03a2d.tar.gz
STC-modified-c1ecb1ac75664b0771993582fda9919e52d03a2d.zip
Switched from "\\" as replacement group prefix to '$'. cregex_replace() changed: removed the last two args.
Diffstat (limited to 'include/stc')
-rw-r--r--include/stc/cregex.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/stc/cregex.h b/include/stc/cregex.h
index fff8ccb1..1b77a980 100644
--- a/include/stc/cregex.h
+++ b/include/stc/cregex.h
@@ -97,8 +97,11 @@ int cregex_match_p(const char* input, const char* pattern,
csview match[], int cmflags);
/* replace regular expression */
-cstr cregex_replace(const char* input, const cregex* re, const char* replace,
- bool (*mfun)(int i, csview match, cstr* mstr), unsigned count);
+cstr cregex_replace_re(const char* input, const cregex* re, const char* replace,
+ bool (*mfun)(int i, csview match, cstr* mstr), unsigned count);
+static inline
+cstr cregex_replace(const char* input, const cregex* re, const char* replace)
+ { return cregex_replace_re(input, re, replace, NULL, 0); }
/* replace + compile RE pattern, and extra arguments */
cstr cregex_replace_pe(const char* input, const char* pattern, const char* replace,