Skip to content

Commit

Permalink
another fix for back-search
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed May 28, 2024
1 parent ef5b7d5 commit b7bb814
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/regexpr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6870,12 +6870,12 @@ function TRegExpr.ExecPrimProtected(AOffset: Integer; ASlowChecks,
if (TempMatchPos + TempMatchLen - 1 > AOffset) then
Continue;

// do we have surrounding match at prev pos for regex 'w+'? take it.
// if we have surrounding match at prev pos e.g. for regex '\w+', take it
PtrPrev := Ptr;
repeat
if (PtrPrev = fInputStart) then Break;
Dec(PtrPrev);
if MatchAtOnePos(PtrPrev) and (MatchPos[0] + MatchLen[0] = TempMatchPos + TempMatchLen) then
if MatchAtOnePos(PtrPrev) and (MatchPos[0] + MatchLen[0] >= TempMatchPos + TempMatchLen) then
Ptr := PtrPrev
else
begin
Expand Down

0 comments on commit b7bb814

Please sign in to comment.