diff options
| author | Tyge Løvset <[email protected]> | 2022-12-11 10:52:32 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-11 10:52:32 +0100 |
| commit | 0db528ed0062920e9bd5b2c7fcdc7506bd41abad (patch) | |
| tree | 217b0c6b36964b84bac423bfc6a6c3333c0cd83d /include/stc | |
| parent | f500cd5301433015e7860ea4446e81db29c9369e (diff) | |
| parent | 3b616b5260f2f477563508b6eec5370506565da9 (diff) | |
| download | STC-modified-0db528ed0062920e9bd5b2c7fcdc7506bd41abad.tar.gz STC-modified-0db528ed0062920e9bd5b2c7fcdc7506bd41abad.zip | |
Merge branch 'master' of github.com:tylov/STC
Diffstat (limited to 'include/stc')
| -rw-r--r-- | include/stc/cregex.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/stc/cregex.h b/include/stc/cregex.h index 877f4052..57157b47 100644 --- a/include/stc/cregex.h +++ b/include/stc/cregex.h @@ -124,14 +124,18 @@ cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, unsi bool (*mfun)(int i, csview match, cstr* mstr), int rflags); static inline -cstr cregex_replace(const cregex* re, const char* input, const char* replace, unsigned count) { +cstr cregex_replace(const cregex* re, const char* input, const char* replace) { csview sv = {input, strlen(input)}; - return cregex_replace_sv(re, sv, replace, count, NULL, cre_default); + return cregex_replace_sv(re, sv, replace, 0, NULL, cre_default); } /* replace + compile RE pattern, and extra arguments */ -cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, unsigned count, - bool (*mfun)(int i, csview match, cstr* mstr), int crflags); +cstr cregex_replace_pattern_n(const char* pattern, const char* input, const char* replace, unsigned count, + bool (*mfun)(int i, csview match, cstr* mstr), int crflags); +static inline +cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace) + { return cregex_replace_pattern_n(pattern, input, replace, 0, NULL, cre_default); } + /* destroy regex */ void cregex_drop(cregex* self); |
