fork(1) 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 pattern = @"(?<=\[must_contain_this_word].*?)\s+[a-zA-Z](?!\S)";
  12. var s = "[must_contain_this_word] text1 a text2 b text3 c";
  13. Console.WriteLine(Regex.Replace(s,pattern, ""));
  14. }
  15. }
Success #stdin #stdout 0.06s 21216KB
stdin
Standard input is empty
stdout
[must_contain_this_word] text1 text2 text3