Currently this regex returns one match:
the best language in the world and the fastest language
How can I get it to return two matches:
the best language
the fastest language
string text = "C# is the best language in the world and the fastest language in the world";
string search = @"\bthe\b.*\blanguage\b";
MatchCollection matches = Regex.Matches(text, search);
Console.WriteLine("{0} matches", matches.Count);
foreach (Match match in matches)
{
Console.WriteLine("match '{0}' was found at index {1}", match.Value, match.Index);
}
Console.WriteLine("---");