using System.Text.RegularExpressions;
public static void Main()
Regex rx = new Regex(@"(?<!:):(?!:)(.+?)$", RegexOptions.Multiline);
string text = "blah % blah :stuff\nblah %blah% blah\nblah %blah% blah\nblah %% blah\nblah blah % ::whatever";
MatchCollection matches = rx.Matches(text);
Console.WriteLine("{0} matches found in:\n {1}", matches.Count, text);
foreach (Match match in matches)
GroupCollection groups = match.Groups;
Console.WriteLine("'{0}' repeated at positions {1} and {2}", groups[0].Value, groups[0].Index, groups[1].Index);