I have this:
(defn page1 []
(layout/render
"index.html"
({:articles (db/get-articles)})))
The function
db/get-articles
returns a list of objects which have the key body. I need to parse the body of the articles and replace, if exists, a substring "aaa12aaa"
with "bbb13bbb"
, "aaa22aaa"
with "bbb23bbb"
and so on in the bodies. How can I do that so it also won't consume plenty of RAM? Is using regex effective?
UPDATE:
The pattern I need to replace is : "[something="X" something else/]". where X is a number and it's unknown. I need to change X. There can be many such patterns to replace or none.