fork(1) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. string sample = " class0 .calss1 .class2 .class3.class4 .class5 class6 .class7";
  10. Regex regex = new Regex(@"\.[^ .]+");
  11. var matches = regex.Matches(sample);
  12. string[] result = matches.Cast<Match>().Select(x => x.Value).ToArray();
  13. foreach (string word in result)
  14. {
  15. Console.WriteLine(word);
  16. }
  17. }
  18. }
Success #stdin #stdout 0.08s 34072KB
stdin
Standard input is empty
stdout
.calss1
.class2
.class3
.class4
.class5
.class7