diff options
| author | 2023-09-17 02:52:44 +0200 | |
|---|---|---|
| committer | 2023-09-17 02:52:44 +0200 | |
| commit | 952da47c6d2a209e6a41fabe7a5365380d63a5e5 (patch) | |
| tree | 07677a47664d9d4490ab16e521d7cfdabeb4fd6c /xs_regex.h | |
| parent | Also accept Update activities for Page and Article. (diff) | |
| download | snac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.tar.gz snac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.tar.xz snac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.zip | |
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 @@ | |||
| 6 | 6 | ||
| 7 | xs_list *xs_regex_split_n(const char *str, const char *rx, int count); | 7 | xs_list *xs_regex_split_n(const char *str, const char *rx, int count); |
| 8 | #define xs_regex_split(str, rx) xs_regex_split_n(str, rx, XS_ALL) | 8 | #define xs_regex_split(str, rx) xs_regex_split_n(str, rx, XS_ALL) |
| 9 | xs_list *xs_regex_match_n(const char *str, const char *rx, int count); | 9 | xs_list *xs_regex_select_n(const char *str, const char *rx, int count); |
| 10 | #define xs_regex_match(str, rx) xs_regex_match_n(str, rx, XS_ALL) | 10 | #define xs_regex_select(str, rx) xs_regex_select_n(str, rx, XS_ALL) |
| 11 | xs_list *xs_regex_replace_in(xs_str *str, const char *rx, const char *rep, int count); | 11 | xs_list *xs_regex_replace_in(xs_str *str, const char *rx, const char *rep, int count); |
| 12 | #define xs_regex_replace_i(str, rx, rep) xs_regex_replace_in(str, rx, rep, XS_ALL) | 12 | #define xs_regex_replace_i(str, rx, rep) xs_regex_replace_in(str, rx, rep, XS_ALL) |
| 13 | #define xs_regex_replace_n(str, rx, rep, count) xs_regex_replace_in(xs_dup(str), rx, rep, count) | 13 | #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) | |||
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | xs_list *xs_regex_match_n(const char *str, const char *rx, int count) | 58 | xs_list *xs_regex_select_n(const char *str, const char *rx, int count) |
| 59 | /* returns a list with upto count matches */ | 59 | /* selects all matches and return them as a list */ |
| 60 | { | 60 | { |
| 61 | xs_list *list = xs_list_new(); | 61 | xs_list *list = xs_list_new(); |
| 62 | xs *split = NULL; | 62 | xs *split = NULL; |