diff options
author | default <nobody@localhost> | 2023-09-17 02:52:44 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-09-17 02:52:44 +0200 |
commit | 952da47c6d2a209e6a41fabe7a5365380d63a5e5 (patch) | |
tree | 07677a47664d9d4490ab16e521d7cfdabeb4fd6c /xs_regex.h | |
parent | 2edbb75a183d631fb77d4e9be0862116dab9190d (diff) |
Backport from xs.
Diffstat (limited to 'xs_regex.h')
-rw-r--r-- | xs_regex.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -6,8 +6,8 @@ xs_list *xs_regex_split_n(const char *str, const char *rx, int count); #define xs_regex_split(str, rx) xs_regex_split_n(str, rx, XS_ALL) -xs_list *xs_regex_match_n(const char *str, const char *rx, int count); -#define xs_regex_match(str, rx) xs_regex_match_n(str, rx, XS_ALL) +xs_list *xs_regex_select_n(const char *str, const char *rx, int count); +#define xs_regex_select(str, rx) xs_regex_select_n(str, rx, XS_ALL) xs_list *xs_regex_replace_in(xs_str *str, const char *rx, const char *rep, int count); #define xs_regex_replace_i(str, rx, rep) xs_regex_replace_in(str, rx, rep, XS_ALL) #define xs_regex_replace_n(str, rx, rep, count) xs_regex_replace_in(xs_dup(str), rx, rep, count) @@ -55,8 +55,8 @@ xs_list *xs_regex_split_n(const char *str, const char *rx, int count) } -xs_list *xs_regex_match_n(const char *str, const char *rx, int count) -/* returns a list with upto count matches */ +xs_list *xs_regex_select_n(const char *str, const char *rx, int count) +/* selects all matches and return them as a list */ { xs_list *list = xs_list_new(); xs *split = NULL; |