diff --git a/iped-engine/src/main/java/iped/engine/task/regex/RegexTask.java b/iped-engine/src/main/java/iped/engine/task/regex/RegexTask.java index c82d96c276..ba10849501 100644 --- a/iped-engine/src/main/java/iped/engine/task/regex/RegexTask.java +++ b/iped-engine/src/main/java/iped/engine/task/regex/RegexTask.java @@ -303,11 +303,11 @@ private void processRegex(IItem evidence, Reader reader) throws IOException { while (fullMatcher.find()) { int start = fullMatcher.start(); int end = fullMatcher.end(); - String hit = text.substring(start, end); + String fullHit = text.substring(start, end); int i = 0; for (Regex regex : regexList) { - if (regex.pattern.run(hit)) { - hit = hit.substring(regex.prefix, hit.length() - regex.sufix); + if (regex.pattern.run(fullHit)) { + String hit = fullHit.substring(regex.prefix, fullHit.length() - regex.sufix); if (regex.ignoreCases) hit = hit.toLowerCase(); if (regexValidator.validate(regex, hit)) {