using System;
using System.Text.RegularExpressions;
class Program
{
public static void WordsMatchWith(string str, string expr) {
MatchCollection mc = Regex.Matches(str, expr);
foreach (var word in mc)
Console.WriteLine(word);
}
static void Main() {
string str = "Marquee C# make net Make c programming m Mixable M Me";
WordsMatchWith(str, @"\bM\S*e\b");
}
}
/*
run:
Marquee
Make
Mixable
Me
*/