Skip to content

Commit

Permalink
'#1897: Fix regex processing with multiple hits for the same string.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Sep 26, 2023
1 parent 5d954a3 commit c9cfc3f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit c9cfc3f

Please sign in to comment.