ankidroid/Anki-Android — pull request #150 by pabloem (2013-12-31 07:23:07+00:00)
Title: Issue 1852 - Using wildcards in field searches is not working properly

Corrected the code that is in charge of matching regular expressions of fields. The problem was that we needed to use different syntax for SQL Lite and the Java Pattern class, when matching the expressions.

Also, removed the line:
```
String regex = Pattern.quote(val).replace("\\Q_\\E", ".").replace("\\Q%\\E", ".*");
```
Because the regex matching already makes sure that the string matches exactly.

Also, created the pattern outside of the loop, to make sure only one is created:
```
Pattern thePattern = Pattern.compile(val, Pattern.CASE_INSENSITIVE);
while(...
```
Also made sure to test several cases of field search. Any comments are welcome!