bug in regexpr in procedure TRegExpr.Split / returns empty tstrings
Original Reporter info from Mantis: sstvmaster @sstvmaster
-
Reporter name: sstvmaster
Original Reporter info from Mantis: sstvmaster @sstvmaster
- Reporter name: sstvmaster
Description:
I think i have found a bug in procedure TRegExpr.Split it returns always an empty list.
Additional information:
Patch:
@@ -3920,10 +3920,10 @@
PrevPos := 1;
if Exec(AInputStr) then
REPEAT
- APieces.Add(System.Copy (AInputStr, PrevPos, MatchPos[0] - PrevPos));
+ APieces.Add(System.Copy (AInputStr, PrevPos, MatchLen[0]));
PrevPos := MatchPos[0] + MatchLen[0];
UNTIL not ExecNext;
- APieces.Add (System.Copy (AInputStr, PrevPos, MaxInt)); // Tail
+ //APieces.Add (System.Copy (AInputStr, PrevPos, MaxInt)); // Tail
end; { of procedure TRegExpr.Split
--------------------------------------------------------------}
Mantis conversion info:
- Mantis ID: 35438
- OS: Windows
- OS Build: 7 32/64bit
- Platform: Windows
- Version: 3.0.4
- Fixed in version: 3.2.0
- Target version: 3.2.0