Fixed issue 34: Behavior of Text Filter is unpredictable when "regular expression" mode is enabled.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@766 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
0af4e294f8
commit
bd87e079b2
@ -1,3 +1,10 @@
|
|||||||
|
Ongoing
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- Issue 34: "Behavior of Text Filter is unpredictable when "regular expression" mode is enabled."
|
||||||
|
Regex was not compiled with case insensitivity flag.
|
||||||
|
|
||||||
|
|
||||||
1.0.1 Release (May 12, 2010)
|
1.0.1 Release (May 12, 2010)
|
||||||
|
|
||||||
Fixes:
|
Fixes:
|
||||||
|
@ -58,19 +58,16 @@ public class TextSearchFacet implements Facet {
|
|||||||
_mode = o.getString("mode");
|
_mode = o.getString("mode");
|
||||||
_caseSensitive = o.getBoolean("caseSensitive");
|
_caseSensitive = o.getBoolean("caseSensitive");
|
||||||
if (_query != null) {
|
if (_query != null) {
|
||||||
_query = _query.trim();
|
if ("regex".equals(_mode)) {
|
||||||
if (_query.length() > 0) {
|
try {
|
||||||
if (!_caseSensitive) {
|
_pattern = Pattern.compile(
|
||||||
_query = _query.toLowerCase();
|
_query,
|
||||||
}
|
_caseSensitive ? 0 : Pattern.CASE_INSENSITIVE);
|
||||||
|
} catch (java.util.regex.PatternSyntaxException e) {
|
||||||
if ("regex".equals(_mode)) {
|
e.printStackTrace();
|
||||||
try {
|
|
||||||
_pattern = Pattern.compile(_query);
|
|
||||||
} catch (java.util.regex.PatternSyntaxException e) {
|
|
||||||
//e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else if (!_caseSensitive) {
|
||||||
|
_query = _query.toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user