using System.Text.RegularExpressions;
namespace RegExApplication
private static void showMatch(string text, string expr)
Console.WriteLine("The Expression: " + expr);
MatchCollection mc = Regex.Matches(text, expr);
public static void Main(String[] args)
string str = "A Thousand Splendid Suns";
Console.WriteLine("Matching Words That Starts with 's': ");
showMatch(str, @"\bS\S*");