add regex w/ position util

This commit is contained in:
Adam Jeniski 2023-12-03 09:58:54 -05:00
parent 20539f6005
commit e68a957a69

View File

@ -14,5 +14,12 @@
:body :body
string/split-lines)))) string/split-lines))))
(defn re-seq-pos [pattern string]
(let [m (re-matcher pattern string)]
((fn step []
(when (. m find)
(cons {:start (. m start) :end (. m end) :group (. m group)}
(lazy-seq (step))))))))
(comment (comment
input-cache) input-cache)