mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 11:23:17 -09:00
add regex w/ position util
This commit is contained in:
parent
20539f6005
commit
e68a957a69
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user