use the same regex for lucene escapes, close #143

The escapes for the value were updated recently but the escapes for the
query were forgotten.
Now we use a variable for the regex to reduce duplication.
I had a patch ready this morning too, but I made the replace string a re.compile() object and used obj.sub() instead. A litte more efficient again.