diff options
Diffstat (limited to 'tools.pas')
-rw-r--r-- | tools.pas | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -9,6 +9,7 @@ uses type tAktualitaet = (aNichtVorhanden,aVeraltet,aAktuell,aWirdErneuert); + tRegexTyp = (rtKein,rtFpc,rtShell); tMyStringListBArray = array[boolean] of tMyStringList; tSummenDatei = record name: string; @@ -43,6 +44,7 @@ procedure testeObBefehlLokal(bef, ordner: string; dateiListe: tMyStringList; lok function extrahiereAlleDateien(woraus: string; dateiListe: tMyStringList): tMyStringList; function unescape(s: string): string; function escape(s,toe: string; ec: char): string; +function escapeStringToRegex(s: string; typ: tRegexTyp; extras: string = ''): string; inline; procedure ersetzeAlleVorkommen(var worin: string; was,wodurch: string); // Routinen für sha512-Prüfsummen @@ -363,6 +365,18 @@ begin end; end; +function escapeStringToRegex(s: string; typ: tRegexTyp; extras: string = ''): string; +begin + case typ of + rtKein: + result:=s; + rtFpc: + result:=escape(s,'\.[+^$'+extras,'\'); + rtShell: + result:=escape(s,'\.[^$'+extras,'\'); + end{of case}; +end; + procedure ersetzeAlleVorkommen(var worin: string; was,wodurch: string); begin while pos(was,worin)>0 do begin |