Skip to content

Commit

Permalink
splitn with a default
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Sep 29, 2024
1 parent fe46a3a commit 88f63d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dm/regex/global.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#define aneri_regex_is_match(regex, haystack) (ANERI_CALL("regex_is_match", regex, haystack))
#define aneri_regex_split(regex, haystack) (ANERI_CALL("regex_split", regex, haystack))
#define aneri_regex_splitn(regex, haystack, limit) (ANERI_CALL("regex_splitn", regex, haystack, limit))
#define aneri_regex_replace(regex, haystack, with) (ANERI_CALL("regex_replace", regex, haystack, with))
#define aneri_regex_replace_all(regex, haystack, with) (ANERI_CALL("regex_replace_all", regex, haystack, with))

/proc/aneri_regex_splitn(regex, haystack, limit = 1)
return ANERI_CALL("regex_splitn", regex, haystack, split)

/proc/aneri_regex_find(regex, haystack) as /list
return ANERI_CALL("regex_replace_find", regex, haystack)

0 comments on commit 88f63d9

Please sign in to comment.