Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace RegexFullName
- {
- class Program
- {
- static void Main()
- {
- Regex pattern = new Regex(@"^[A-Z][a-z]+\s{1}[A-Z][a-z]+$");
- string name = Console.ReadLine();
- MatchCollection matches = pattern.Matches(name);
- foreach (Match m in matches)
- {
- Console.Write(m.Groups[0].Value + " ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement