using System.Text.RegularExpressions;
string input = "apikey:1234\\:5678;persoon:antoi\\;one\\";
var headers = Regex.Split(input, "(?<=[^\\\\]);").Select(sets => {
var parts = Regex.Split(sets.Replace("\\;", ";"), "(?<=[^\\\\]):")
.Select(x => x.Replace("\\:", ":"))
return new { key = parts[0], value = parts[1] };
.ToDictionary(k => k.key, v => v.value);
foreach (var header in headers)
Console.WriteLine($"\"{header.Key}\" = \"{header.Value}\"");