summaryrefslogtreecommitdiff
path: root/mystringlistunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'mystringlistunit.pas')
-rw-r--r--mystringlistunit.pas6
1 files changed, 3 insertions, 3 deletions
diff --git a/mystringlistunit.pas b/mystringlistunit.pas
index af03f4a..31f9af5 100644
--- a/mystringlistunit.pas
+++ b/mystringlistunit.pas
@@ -25,7 +25,7 @@ type
procedure saveToGz(const s: ansiString);
function readln(out s: string): boolean; inline;
function metaReadln(out s: string; subRoutine: boolean): boolean; inline;
- procedure grep(expr: string);
+ procedure grep(expr: string; invert: boolean = false);
function grepFirst(expr: string): string;
function hatZeile(zeile: string): boolean; // invers zu "grep -c"
function eof: boolean;
@@ -185,7 +185,7 @@ begin
result:=readln(s);
end;
-procedure tMyStringlist.grep(expr: string);
+procedure tMyStringlist.grep(expr: string; invert: boolean);
var
re: tRegExpr;
i: longint;
@@ -193,7 +193,7 @@ begin
re:=tRegExpr.create;
re.expression:=expr;
for i:=count-1 downto 0 do
- if not re.exec(self[i]) then
+ if not invert xor re.exec(self[i]) then
delete(i);
re.free;
end;