RosettaCodeData/Task/Multisplit/NewLISP/multisplit.l
2024-10-16 18:07:41 -07:00

9 lines
284 B
Text

(define (multi-split str seps)
(let (parsed
(find-all
(string {((.*?)(} (join (map string seps) "|") {))|(.+)$})
str
(if (= "" $3) (list $4) (list $2 $3))))
(list parsed (map first parsed))))
(multi-split "a!===b=!=c" '(== != =))