From ec85979bbe90f9f2613bf742ba5cb4c7ec4d2403 Mon Sep 17 00:00:00 2001 From: millmanorama Date: Wed, 14 Sep 2016 12:48:30 +0200 Subject: [PATCH] revert broken change that attempted to find more hits, but actually found less... --- .../keywordsearch/TermComponentQuery.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermComponentQuery.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermComponentQuery.java index 7e6b820169..fb701716ba 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermComponentQuery.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/TermComponentQuery.java @@ -187,25 +187,18 @@ final class TermComponentQuery implements KeywordSearchQuery { try { //if the keyword hit matched the credit card number keyword/regex... if (keyword.getType() == ATTRIBUTE_TYPE.TSK_ACCOUNT_NUMBER) { - termHit = CharMatcher.inRange('0', '9').negate().trimFrom(termHit); newArtifact = hit.getContent().newArtifact(ARTIFACT_TYPE.TSK_CREDIT_CARD_ACCOUNT); // make account artifact //try to match it against the track 1 regex Matcher matcher = TRACK1_PATTERN.matcher(hit.getSnippet()); - while (matcher.find()) { - if (termHit.equals(matcher.group("accountNumber"))) { - parseTrack1Data(newArtifact, matcher); - break; - } + if (matcher.find()) { + parseTrack1Data(newArtifact, matcher); } + //then try to match it against the track 2 regex matcher = TRACK2_PATTERN.matcher(hit.getSnippet()); - while (matcher.find()) { - final String group = matcher.group("accountNumber"); - if (termHit.equals(group)) { - parseTrack2Data(newArtifact, matcher); - break; - } + if (matcher.find()) { + parseTrack2Data(newArtifact, matcher); } if (hit.getContent() instanceof AbstractFile) { AbstractFile file = (AbstractFile) hit.getContent();