fork 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 strs = new List<string> { " [ f ] s = t", "s = t"};
  12. var pattern = @"(?:^\p{Zs}*|])([^]=]*)=";
  13. foreach (var s in strs)
  14. {
  15. var match = Regex.Match(s, pattern);
  16. if (match.Success)
  17. Console.WriteLine(match.Groups[1].Value);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.11s 24728KB
stdin
Standard input is empty
stdout
 s 
s