'=':
begin
// lookahead: foo(?=bar)
if (regparse + 3 >= fRegexEnd) then
Error(reeLookaheadBad);
GrpKind := gkLookahead;
regLookahead := True;
regLookaheadGroup := regnpar;
// check that these brackets are last in regex
SavedPtr := _FindClosingBracket(regparse + 1, fRegexEnd);
if (SavedPtr <> fRegexEnd - 1) then
Error(reeLookaheadBad);
Inc(regparse, 2);
end;
'!':
begin
// lookahead negative: foo(?!bar)
if (regparse + 3 >= fRegexEnd) then
Error(reeLookaheadBad);
GrpKind := gkLookaheadNeg;
regLookahead := True;
regLookaheadNeg := True;
regLookaheadGroup := regnpar;
// check that these brackets are last in regex
SavedPtr := _FindClosingBracket(regparse + 1, fRegexEnd);
if (SavedPtr <> fRegexEnd - 1) then
Error(reeLookaheadBad);
Inc(regparse, 2);
end;