mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 13:03:19 -09:00
add regex w/ position util
This commit is contained in:
parent
20539f6005
commit
e68a957a69
@ -14,5 +14,12 @@
|
||||
:body
|
||||
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
|
||||
input-cache)
|
||||
|
Loading…
x
Reference in New Issue
Block a user