Skip to content

Commit b7bb814

Browse files
committed
another fix for back-search
1 parent ef5b7d5 commit b7bb814

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/regexpr.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6870,12 +6870,12 @@ function TRegExpr.ExecPrimProtected(AOffset: Integer; ASlowChecks,
68706870
if (TempMatchPos + TempMatchLen - 1 > AOffset) then
68716871
Continue;
68726872

6873-
// do we have surrounding match at prev pos for regex 'w+'? take it.
6873+
// if we have surrounding match at prev pos e.g. for regex '\w+', take it
68746874
PtrPrev := Ptr;
68756875
repeat
68766876
if (PtrPrev = fInputStart) then Break;
68776877
Dec(PtrPrev);
6878-
if MatchAtOnePos(PtrPrev) and (MatchPos[0] + MatchLen[0] = TempMatchPos + TempMatchLen) then
6878+
if MatchAtOnePos(PtrPrev) and (MatchPos[0] + MatchLen[0] >= TempMatchPos + TempMatchLen) then
68796879
Ptr := PtrPrev
68806880
else
68816881
begin

0 commit comments

Comments
 (0)