fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var s = "hello 'world' hehe";
  9. var m = Regex.Match(s, "'([^']*)'");
  10. string res = null;
  11. if (m.Success) {
  12. res = m.Groups[1].ToString();
  13. }
  14. Console.WriteLine(res);
  15. }
  16. }
Success #stdin #stdout 0.07s 34120KB
stdin
Standard input is empty
stdout
world