Imagine, I've a Clojure function similar to that one
(defn ABC
[tag v]
(let [value (->> (str/split v #",")
(map str/trim)
(map u/capitalize)
(str/join ", "))]
...)))
That function could be called many times. Is the regexp #", " will be parsed only once (I hope so)? Any points to source code/proofs of that?
What if I have a second function with the same regexp. Would it be technically the same instance of regexp from the first function? Or it will be 2 independent regexps?
(defn XYZ [v]
(let [adr (str/split v #",")]
(if (> (count adr) 5)
...
)