I need to convert this string
"/{foo}/{bar}.{format}"
in
"/#{a["foo"]}/#{a["bar"]}.#{a["format"]}"
Because I have a list with these attributes. for instance
a["foo"] = "home"
a["bar"] = "picture"
a["format"] = "jpg"
I try to something like this
String.replace(a,"{",~s(#{))
But I got this error (
SyntaxError) iex:8: unexpected token: )
I try even a regexp to create a List to try to have my result but I don't understand how can I apply this regexp ([^{]*?)\w(?=\})