fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var m = Regex.Match("apple", "(?<C>a(?=pple)|b(?=anana)|c(?=herry))");
  12. if (m.Success)
  13. {
  14. Console.WriteLine("fruit\'s initial: {0}", m.Groups["C"].Value);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.05s 134208KB
stdin
Standard input is empty
stdout
fruit's initial: a