using System; using System.Text.RegularExpressions; public class Solution { public static void Main(String[] args) { string input = "where dog is and cats are and bird is bigger than a mouse"; string pattern = "(?:where|and)"; string[] substrings = Regex.Split(input, pattern); foreach (string match in substrings) { Console.WriteLine("'{0}'", match); } } }