Hello all,
I have a template like this:
foo_tmplte = Template("fieldname_${ln}_${type} = $value")
and a lot of strings parsed with this template like this:
foo_str1 = "fieldname_ru_ln = journal"
foo_str2 = "fieldname_zh_TW_ln = journal"
foo_str3 = "fieldname_uk_ln = номер запису"
Now i want to extract back the variables from the template, for example with str1 the result must be:
ln = ru
type = ln
value = journal
I try some approaches but I can't find any elegant and reusable function to extract the variables. Any idea?
Thanks in advance