Advertisement
sivancheva

DBukarova

Nov 3rd, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Text.RegularExpressions;
  7.  
  8.  
  9.  
  10.  
  11. namespace RegexFullName
  12. {
  13. class Program
  14. {
  15. static void Main()
  16. {
  17. Regex pattern = new Regex(@"^[A-Z][a-z]+\s{1}[A-Z][a-z]+$");
  18.  
  19. string name = Console.ReadLine();
  20.  
  21. MatchCollection matches = pattern.Matches(name);
  22.  
  23. foreach (Match m in matches)
  24. {
  25. Console.Write(m.Groups[0].Value + " ");
  26. }
  27. Console.WriteLine();
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement