I was exploring using this on an input field where users can also input regular expressions which I wanted to do through use of a keyword re:. I then realized that it seemingly is impossible to use a backslash in keyword input. A single backslash does get removed, escaping it removes both and the same goes for triple escaping.
From a curious glance at the code it seems that the functionality that is supposed to preserve escapes actually removes them in this case.