using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
Console.WriteLine("..starting");
string sentence = "Lorem ipsum left right sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
Regex regexLeft = new Regex("\\bleft\\b", RegexOptions.IgnoreCase);
Regex regexRight = new Regex("\\bright\\b", RegexOptions.IgnoreCase);
Regex regexBoth = new Regex("\\bboth|multifocal|bilateral\\b", RegexOptions.IgnoreCase);
Match BothMatch = regexBoth.Match(sentence);
Match LeftMatch = regexLeft.Match(sentence);
Match RightMatch = regexRight.Match(sentence);
Console.WriteLine("BOTH keyword match '" + BothMatch.Value + "' found at char " + BothMatch.Index);
else if(!((LeftMatch.Success || RightMatch.Success) && !(LeftMatch.Success && RightMatch.Success)))
Console.WriteLine("Match 1 LEFT match: '" + LeftMatch.Value + "' found at char " + LeftMatch.Index + " ... " + "RIGHT match: '" + RightMatch.Value + "' found at char " + RightMatch.Index);
else if(LeftMatch.Success && RightMatch.Success)
Console.WriteLine("Match 2 LEFT match: '" + LeftMatch.Value + "' found at char " + LeftMatch.Index + " ... " + "RIGHT match: '" + RightMatch.Value + "' found at char " + RightMatch.Index);
Console.WriteLine("There was no match");