revert broken change that attempted to find more hits, but actually found less...

This commit is contained in:
millmanorama 2016-09-14 12:48:30 +02:00
parent b09b9d6d25
commit ec85979bbe

View File

@ -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();