fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"(?<=^(?:\w+=)?)\w+(?=;)";
  9. string input = @"word2;word3
  10. word1=word2;word3";
  11. RegexOptions options = RegexOptions.Multiline;
  12.  
  13. foreach (Match m in Regex.Matches(input, pattern, options))
  14. {
  15. Console.WriteLine( m.Value);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.03s 134592KB
stdin
Standard input is empty
stdout
word2
word2