A simple template/replace for erlang lists/strings
2> template:replace("Hello $(NAME)", #{"NAME" => "John Doe"}).
"Hello John Doe"
3> template:replace("Hello $(GIVEN_NAME) $(SURNAME)", #{"GIVEN_NAME" => "John", "SURNAME" => "Doe"}).
"Hello John Doe"
4> template:replace("Hello $(NAME)", #{}).
{error,{bad_key,"NAME"}}
5> template:replace("Hello $(NAME", #{"NAME" => "John"}).
{error,eof}
2> template:match("$(A)bc", "abc").
#{"A" => "a"}
3> template:match("a$(A)$(A)a", "abba").
#{"A" => "b"}
4> template:match("$(A)bcd$(B)", "bcde").
#{"A" => [],"B" => "e"}
5> template:match("$(A)bc$(A)", "abcd").
{error,no_match}
6> template:match("$(A)bc$(A", "abcd").
{error,eof}