(bind-func regex_split
(lambda (regex str)
(let ((a:i8* (salloc 2048))
(b:i8* (salloc 2048)))
(sprintf a "")
(sprintf b "")
(rsplit regex (cstring str) a b)
(append (list (if (> (strlen a) 0)
(String a) (String str)))
(if (> (strlen b) 0)
(regex_split regex (String b))
null)))))