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 ConsoleApp213
- {
- class Program
- {
- static void Main(string[] args)
- {
- string text = Console.ReadLine();
- string pattern = @"(\+359([ -])2(\2)(2{3})(\2)(2{4}))\b";
- MatchCollection matches = Regex.Matches(text, pattern);
- var phones = new List<string>();
- foreach(Match match in matches)
- {
- phones.Add(match.Value);
- }
- Console.Write(string.Join(", ",phones));
- Console.Write("\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement