diff --git a/anki/models.py b/anki/models.py index bd363514b..6f11bc05f 100644 --- a/anki/models.py +++ b/anki/models.py @@ -304,7 +304,7 @@ and notes.mid = ? and cards.ord = ?""", m['id'], ord) def renameField(self, m, field, newName): self.col.modSchema(check=True) - pat = r'{{(.*)([:#^/]|[^:#/^}][^:}]*?:|)%s}}' + pat = r'{{([^{}]*)([:#^/]|[^:#/^}][^:}]*?:|)%s}}' def wrap(txt): def repl(match): return '{{' + match.group(1) + match.group(2) + txt + '}}'