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.RegularExpressions;
- using System.Threading.Tasks;
- namespace _07.Match_Hexadecimal_Numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- var regex = @"\b(?:0x)?[0-9A-F]+\b";
- var input = Console.ReadLine();
- var result = Regex.Matches(input, regex)
- .Cast<Match>()
- .Select(a => a.Value)
- .ToArray();
- Console.WriteLine(string.Join(" ", result));
- }
- }
- }
Add Comment
Please, Sign In to add comment