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.