anchor.diff:  let (>**) pattern text = (getRegEx pattern).IsMatch text
   
   /// Decodes a Base64-encoded UTF-8-encoded string
  -let DecodeBase64Utf8String (text:string) = 
  -  text
  -  |> Convert.FromBase64String
  -  |> Encoding.UTF8.GetString+let DecodeBase64Utf8String(text : string) = 
  +    text
  +    |> Convert.FromBase64String
  +    |> Encoding.UTF8.GetString
  
positive.code: 
  /// Writes a file line by line
  let WriteFile file lines = WriteToFile false file lines
    
  /// Appends all lines to a file line by line
  let AppendToFile file lines = WriteToFile true file lines
  
  /// Reads a file as one text
  let inline ReadFileAsString file = File.ReadAllText(file,encoding)
  
  /// Reads a file as one array of bytes
  let ReadFileAsBytes = File.ReadAllBytes
  
negative.code: let inline appendStringIfValueIsNotNullOrEmpty value = appendIfTrue (isNullOrEmpty value |> not)
  
  /// Appends a text if the value is not null or empty.
  let inline appendIfNotNullOrEmpty value s = appendIfTrue (isNotNullOrEmpty value) (sprintf "%s%s" s value)
  
  /// Appends all notnull fileNames.
  let inline appendFileNamesIfNotNull fileNames (builder : StringBuilder) = 
      fileNames |> Seq.fold (fun builder file -> appendIfTrue (isNullOrEmpty file |> not) file builder) builder
  
  /// Returns the text from the StringBuilder
  let inline toText (builder : StringBuilder) = builder.ToString()
  
  /// [omit]
  let private regexes = new Dictionary<_, _>()
  
  /// [omit]
  let getRegEx pattern = 
      match regexes.TryGetValue pattern with
      | true, regex -> regex
      | _ -> (new System.Text.RegularExpressions.Regex(pattern))
  
  /// [omit]
  let regex_replace pattern (replacement : string) text = (getRegEx pattern).Replace(text, replacement)
  
  /// Checks whether the given char is a german umlaut.
  let isUmlaut c = Seq.exists ((=) c) [ 'ä'; 'ö'; 'ü'; 'Ä'; 'Ö'; 'Ü'; 'ß' ]
  
  /// Converts all characters in a string to lower case.
  let inline toLower (s : string) = s.ToLower()
  
  /// Returns all standard chars and digits.
  let charsAndDigits = [ 'a'..'z' ] @ [ 'A'..'Z' ] @ [ '0'..'9' ]
  
  /// Checks whether the given char is a standard char or digit.
  let isLetterOrDigit c = List.exists ((=) c) charsAndDigits
  
  /// Trims the given string with the DirectorySeparatorChar
  let inline trimSeparator (s : string) = s.TrimEnd Path.DirectorySeparatorChar
  
  /// Trims all special characters from a string.
  let inline trimSpecialChars (text : string) = 
      text
      |> Seq.filter isLetterOrDigit
      |> Seq.filter (isUmlaut >> not)
      |> Seq.fold (fun (acc : string) c -> acc + string c) ""
  
  /// Trims the given string
  let inline trim (x : string) = 
      if isNullOrEmpty x then x
      else x.Trim()
  
  /// Trims the given string
  let inline trimChars chars (x : string) = 
      if isNullOrEmpty x then x
      else x.Trim chars
  
  /// Lifts a string to an option
  let liftString x = 
      if isNullOrEmpty x then None
      else Some x
  
  /// Reads a file line by line
  let ReadFile(file : string) = 
      seq { 
          use textReader = new StreamReader(file, encoding)
          while not textReader.EndOfStream do
              yield textReader.ReadLine()
      }
  
  /// Reads the first line of a file. This can be helpful to read a password from file.
  let ReadLine(file : string) = 
      use sr = new StreamReader(file, Encoding.Default)
      sr.ReadLine()
  
  /// Writes a file line by line
  let WriteToFile append fileName (lines : seq<string>) = 
      let fi = fileInfo fileName
      use writer = new StreamWriter(fileName, append && fi.Exists, encoding)
      lines |> Seq.iter writer.WriteLine
  
  /// Removes all trailing .0 from a version string
  let rec NormalizeVersion(version : string) = 
      let elements = version.Split [| '.' |]
      let mutable version = ""
      for i in 0..3 do
          if i < elements.Length then 
              if version = "" then version <- elements.[i]
              else version <- version + "." + elements.[i]
      if version.EndsWith ".0" then version.Remove(version.Length - 2, 2) |> NormalizeVersion
      else version
  
  /// Writes a byte array to a file
  let WriteBytesToFile file bytes = File.WriteAllBytes(file, bytes)
  
  /// Writes a string to a file
  let WriteStringToFile append fileName (text : string) = 
      let fi = fileInfo fileName
      use writer = new StreamWriter(fileName, append && fi.Exists, encoding)
      writer.Write text
  
  /// Replaces the file with the given string
  let ReplaceFile fileName text = 
      let fi = fileInfo fileName
      if fi.Exists then 
          fi.IsReadOnly <- false
          fi.Delete()
      WriteStringToFile false fileName text
  