using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace ConsoleApplication2
public static void Main(string[] args)
string test = "(anything)....bbbbbb....(anything)";
Regex r = new Regex("b(?=b)");
var s = new System.Diagnostics.Stopwatch();
var result = r.Matches(test);
Console.WriteLine(s.ElapsedTicks.ToString());
while((pos = test.IndexOf(needle, pos)) != -1)
Console.WriteLine(s.ElapsedTicks.ToString());