I'm making regex based search engine.
For example if a query matches (?P<filename>\d+@\d+)
then I want to run the query {"table": "records", "filter": {"filename": "*filename"}}
. But before doing so I want to replace "*filename" with say "2786@20150510201045".
So basically I want to loop through a nested dictionary and replace anything starting with * with the value from the corresponding regex named group. The closest I've found is Loop through all nested dictionary values?