Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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