using System.Text.RegularExpressions;
public static void Main()
const string frequencies = "a2#b2#c2#d2#e2#\r1#\n1#\0";
var dictionary = Regex.Matches(frequencies, @".\d+.", RegexOptions.Singleline).Cast<Match>().ToDictionary(x => Convert.ToByte(x.Value[0]), x => int.Parse(x.Value.Substring(1, x.Value.Length - 2)));
foreach (var item in dictionary)
Console.WriteLine("{0} : {1}", item.Key, item.Value);