Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace _10a_Regular_Expressions_RegEx_Lab
- {
- class Regular_Expressions_RegEx_Lab
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- Regex reg = new Regex(@"\b[0x]*?[0-9A-F]+\b");
- var matches = reg.Matches(input).Cast<Match>().Select(m => m.Value).ToArray();
- //Thiw below is working only in ".NET Core"!?
- //MatchCollection matches = reg.Matches(input);
- Console.WriteLine(string.Join(" ", matches));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment