Advertisement
elena1234

MatchFullName-regex

Nov 20th, 2020 (edited)
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace text
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             var regex =new Regex(@"\b[A-Z][a-z]+ [A-Z][a-z]+\b");
  11.             var text = Console.ReadLine();
  12.             var matches = regex.Matches(text);
  13.             Console.WriteLine(string.Join(" ",matches));
  14.         }
  15.     }
  16. }    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement