fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string pattern = @"(?<={{)\w+(?=}})";
  8. string input = @"{{aaa}}";
  9.  
  10. foreach (Match m in Regex.Matches(input, pattern))
  11. {
  12. Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
  13. }
  14. }
  15. }
Success #stdin #stdout 0.02s 134720KB
stdin
Standard input is empty
stdout
'aaa' found at index 2.