Skip to content
Snippets Groups Projects
Commit 0ff9ba71 authored by Kelly Kelly's avatar Kelly Kelly
Browse files

Fixed exact match issue

parent b6ca418c
No related branches found
No related tags found
No related merge requests found
......@@ -77,13 +77,11 @@ void searchChunk(Chunk chunk) throws TskCoreException {
keywordHits.addAll(createKeywordHits(chunk, originalKeyword));
}
} else {
String regex = ".*\\b" + Pattern.quote(originalKeyword.getSearchTerm().toLowerCase()) + "\\b.*";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(chunk.geLowerCasedChunk());
if (matcher.find()) {
String REGEX_FIND_WORD="(?i).*?\\b%s\\b.*?";
String regex=String.format(REGEX_FIND_WORD, Pattern.quote(originalKeyword.getSearchTerm().toLowerCase()));
if(chunk.geLowerCasedChunk().matches(regex)) {
keywordHits.addAll(createKeywordHits(chunk, originalKeyword));
}
}
}
} else {
String regex = originalKeyword.getSearchTerm();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment