diff options
| author | Tyge Løvset <[email protected]> | 2022-12-08 16:36:30 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-12-08 16:36:30 +0100 |
| commit | 3b616b5260f2f477563508b6eec5370506565da9 (patch) | |
| tree | 99cc4b4edfb5b09289574a4f24053e3d1044eee0 /docs/cregex_api.md | |
| parent | 0eadaa1220e1ba0382638067aaf8566c216765fd (diff) | |
| download | STC-modified-3b616b5260f2f477563508b6eec5370506565da9.tar.gz STC-modified-3b616b5260f2f477563508b6eec5370506565da9.zip | |
Changed/simplified cregex_replace*() API.
Diffstat (limited to 'docs/cregex_api.md')
| -rw-r--r-- | docs/cregex_api.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/cregex_api.md b/docs/cregex_api.md index f1fd7461..865e569e 100644 --- a/docs/cregex_api.md +++ b/docs/cregex_api.md @@ -38,11 +38,13 @@ int cregex_find_pattern(const char* pattern, const char* input, csview m bool cregex_is_match(const cregex* re, const char* input); -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); cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, unsigned count, bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); -cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, unsigned count, - bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); + +cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace); +cstr cregex_replace_pattern_n(const char* pattern, const char* input, const char* replace, unsigned count, + bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); void cregex_drop(cregex* self); // destroy ``` @@ -104,7 +106,7 @@ int main() { printf("Could not find any date\n"); // Lets change all dates into US date format MM/DD/YYYY: - cstr us_input = cregex_replace(&re, input, "$2/$3/$1", 0); + cstr us_input = cregex_replace(&re, input, "$2/$3/$1"); printf("US input: %s\n", cstr_str(&us_input)); // Free allocated data |
