diff options
| author | Tyge Løvset <[email protected]> | 2023-02-01 10:12:22 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2023-02-01 10:12:22 +0100 |
| commit | a8998a52082f86a71bf152c5baa9ebc005871142 (patch) | |
| tree | e231d86dba26d1495b893432fde7db17ac3eac08 /docs/cregex_api.md | |
| parent | 6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (diff) | |
| download | STC-modified-a8998a52082f86a71bf152c5baa9ebc005871142.tar.gz STC-modified-a8998a52082f86a71bf152c5baa9ebc005871142.zip | |
Update docs formatting and README.md
Diffstat (limited to 'docs/cregex_api.md')
| -rw-r--r-- | docs/cregex_api.md | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/docs/cregex_api.md b/docs/cregex_api.md index 3d4392b0..e74040d8 100644 --- a/docs/cregex_api.md +++ b/docs/cregex_api.md @@ -24,35 +24,35 @@ enum { cregex cregex_init(void); cregex cregex_from(const char* pattern, int cflags = CREG_DEFAULT); - /* return CREG_OK, or negative error code on failure */ + // return CREG_OK, or negative error code on failure int cregex_compile(cregex *self, const char* pattern, int cflags = CREG_DEFAULT); - /* num. of capture groups in regex. 0 if RE is invalid. First group is the full match */ + // num. of capture groups in regex. 0 if RE is invalid. First group is the full match int cregex_captures(const cregex* self); - /* return CREG_OK, CREG_NOMATCH, or CREG_MATCHERROR */ + // return CREG_OK, CREG_NOMATCH, or CREG_MATCHERROR int cregex_find(const cregex* re, const char* input, csview match[], int mflags = CREG_DEFAULT); - /* Search inside input string-view only */ + // Search inside input string-view only int cregex_find_sv(const cregex* re, csview input, csview match[]); - /* All-in-one search (compile + find + drop) */ + // All-in-one search (compile + find + drop) int cregex_find_pattern(const char* pattern, const char* input, csview match[], int cmflags = CREG_DEFAULT); - /* Check if there are matches in input */ + // Check if there are matches in input bool cregex_is_match(const cregex* re, const char* input); - /* Replace all matches in input */ -cstr cregex_replace(const cregex* re, const char* input, const char* replace, count = MAX_INT); - /* Replace count matches in input string-view. Optionally transform replacement with mfun. */ -cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, unsigned count = MAX_INT); -cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, unsigned count, + // Replace all matches in input +cstr cregex_replace(const cregex* re, const char* input, const char* replace, int count = INT_MAX); + // Replace count matches in input string-view. Optionally transform replacement with mfun. +cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, int count = INT_MAX); +cstr cregex_replace_sv(const cregex* re, csview input, const char* replace, int count, bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); - /* All-in-one replacement (compile + find/replace + drop) */ -cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, count = MAX_INT); -cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, unsigned count, + // All-in-one replacement (compile + find/replace + drop) +cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, int count = INT_MAX); +cstr cregex_replace_pattern(const char* pattern, const char* input, const char* replace, int count, bool(*mfun)(int capgrp, csview match, cstr* mstr), int rflags); - -void cregex_drop(cregex* self); /* destroy */ + // destroy +void cregex_drop(cregex* self); ``` ### Error codes |
