fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. string s = @"some description ` match these_words th_is_wor ` or `THIS_WOR thi_sqw` a `word_snake`";
  11. string pattern = @"`(?:[\p{Zs}\t]*(\w+)[\p{Zs}\t]*)+`";
  12. foreach (Match m in Regex.Matches(s, pattern))
  13. {
  14. string[] result = m.Groups[1].Captures.Select(c => c.Value).ToArray();
  15. Console.WriteLine(String.Join(',', result));
  16. }
  17. }
  18. }
Success #stdin #stdout 0.12s 26372KB
stdin
Standard input is empty
stdout
match,these_words,th_is_wor
THIS_WOR,thi_sqw
word_snake