jeudi 14 avril 2022

erlang maps key pattern match

I am newer to erlang, I have a map like #{"a/.+":"v1", "b/c/.+": "v2"}

I want to get value by input key like "a/d" to match "a/.+" and get "v1".

It easy to pattern when key is exactly and input key is regex, how can I implement it.

Aucun commentaire:

Enregistrer un commentaire