fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string msg= "xxSTART Here we have the first text in 1234 asdf xxENDxxSTART Here we have the second text 999 fffd xxENDxxSTART Here we have the third text 1234 9985Df xxENDxxSTART Here we have the fourth text 1234 asdf Dert xxEND";
  8. var reg = new Regex(@"^(?:xxSTART.*?){3}\s*(.*?)xxEND");
  9. var match = reg.Match(msg);
  10. string matched = match.Groups[1].Value;
  11. Console.WriteLine(matched);
  12. }
  13. }
Success #stdin #stdout 0.07s 34088KB
stdin
Standard input is empty
stdout
Here we have the third text 1234 9985Df