diff options
Diffstat (limited to 'mystringlistunit.pas')
-rw-r--r-- | mystringlistunit.pas | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mystringlistunit.pas b/mystringlistunit.pas index a5e1139..7aec8ee 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -26,7 +26,7 @@ type function readln(out s: string): boolean; inline; function metaReadln(out s: string; subRoutine: boolean): boolean; inline; procedure grep(expr: string; invert: boolean = false); - function grepFirst(expr: string): string; + function grepFirst(expr: string; invert: boolean = false): string; procedure replace(von,nach: string); procedure uniq(c: char); procedure append(sl: tMyStringList); overload; @@ -215,7 +215,7 @@ begin tl.free; end; -function tMyStringList.grepFirst(expr: string): string; +function tMyStringList.grepFirst(expr: string; invert: boolean = false): string; var re: tRegExpr; i: longint; @@ -223,7 +223,7 @@ begin re:=tRegExpr.create; re.expression:=expr; for i:=count-1 downto 0 do - if re.exec(self[i]) then begin + if invert xor re.exec(self[i]) then begin result:=self[i]; re.free; exit; |