Fix improper use of re.escape() in tests. (GH-4814) (#4817)

(cherry picked from commit b748e3b2586e44bfc7011b601bce9cc6d16d89f1)
1 file changed