summaryrefslogtreecommitdiff
path: root/xs_regex.h
diff options
context:
space:
mode:
authorGravatar default2023-09-17 02:52:44 +0200
committerGravatar default2023-09-17 02:52:44 +0200
commit952da47c6d2a209e6a41fabe7a5365380d63a5e5 (patch)
tree07677a47664d9d4490ab16e521d7cfdabeb4fd6c /xs_regex.h
parentAlso accept Update activities for Page and Article. (diff)
downloadsnac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.tar.gz
snac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.tar.xz
snac2-952da47c6d2a209e6a41fabe7a5365380d63a5e5.zip
Backport from xs.
Diffstat (limited to '')
-rw-r--r--xs_regex.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/xs_regex.h b/xs_regex.h
index 3425661..e86b78e 100644
--- a/xs_regex.h
+++ b/xs_regex.h
@@ -6,8 +6,8 @@
6 6
7xs_list *xs_regex_split_n(const char *str, const char *rx, int count); 7xs_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)
9xs_list *xs_regex_match_n(const char *str, const char *rx, int count); 9xs_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)
11xs_list *xs_regex_replace_in(xs_str *str, const char *rx, const char *rep, int count); 11xs_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
58xs_list *xs_regex_match_n(const char *str, const char *rx, int count) 58xs_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;