dae/libanki — pull request #10 by ospalh (2012-04-30 10:40:43+00:00)
Title: Do the field rename without regular expressions.

The commit dae@62b44df78ea3a5bbf30f5dd2bbafdfb63005629e did what it promised, but in my opinion putting user-provided text into regular expressions is a bad idea.

I accidentally changed a field name into one ending with a backslash. That messes up the template.
Then changing it back is impossible. It gives an
```python
sre_constants.error: unbalanced parenthesis
```
And with a field name of, for example, 'Back\' 'pat % field['name']' gives you '({{|[:#^/])Back\\(}})'. Which indeed contains an unbalanced parenthesis.

So i changed the whole fieldRename back to your old method, with a list of patterns to replace, just using a ':FieldName}} instead of '{{text:FieldName}}' like the re did with nice input.

Some more notes:
I'm rather new to git, so
* please ignore the gitignore
* I tried to just undo the dae@62b44df78ea3a5bbf30f5dd2bbafdfb63005629e, keeping the next commit in place, but didn't manage it. So i copy-and-pasted the old code.

P.S. The problem somewhat reminds me of little Bobby Tables: http://xkcd.com/327/