fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var re = @"aa((?:(?!aa).)*?)kk";
  9. var str = "aa aa value kk 8718764 aa value1 kk kk kk 5178gkjh aathtkhkk";
  10. var res = Regex.Matches(str, re)
  11. .Cast<Match>()
  12. .Select(p => p.Groups[1].Value)
  13. .ToList();
  14. Console.WriteLine(string.Join("\n", res));
  15. }
  16. }
Success #stdin #stdout 0.03s 30392KB
stdin
Standard input is empty
stdout
 value 
 value1 
thtkh