I\'ve been trying to match the following string:
string = \"TEMPLATES = ( (\'index.html\', \'home\'), (\'base.html\', \'base\'))\"
But unfo
If your strings look like valid Python code anyways you can do this:
import ast var, s = [part.strip() for part in "TEMPLATES = ( ('index.html', 'home'), ('base.html', 'base'))".split('=')] result= ast.literal_eval(s)