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.Text.RegularExpressions;
- namespace ConsoleApp2
- {
- class Exercise
- {
- static void Main()
- {
- string text = "Dinko Delchev Trendafilov from Dimitrovgrad born 1979 year.Phone number is 0988719221.";
- string pattern = @"(?<names>[A-Z][a-z]+)(?<digits>\d+)";
- var result = Regex.Matches(text, pattern);
- foreach (Match item in result)
- {
- Console.WriteLine(item.Groups["names"].Value);
- Console.WriteLine(item.Groups["digits"].Value);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement