fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. String str = @"liable for full amount but only in access of the full amount";
  9. Match m = Regex.Match(str, @"^.*?(full)(?:\s+\S+){0,10}?\s+(amount)");
  10. Console.WriteLine("{0} {1}", m.Groups[1].Value, m.Groups[2].Value);
  11. }
  12. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
full amount