using System;
using System.Text.RegularExpressions;
class Program
{
static void Main() {
string pattern = @"\b[M]\w+";
Regex regx = new Regex(pattern);
string s = "Python, Mike, Java, Memory, C, C++, Mcaronis, C#, Mac, PHP, MATLAB";
MatchCollection math = regx.Matches(s);
for (int count = 0; count < math.Count; count++)
Console.WriteLine(math[count].Value);
}
}
/*
run:
Mike
Memory
Mcaronis
Mac
MATLAB
*/