Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- class Program
- {
- static void Main(string[] args)
- {
- string text = "Here is a name @George| and an age #18*";
- Regex reg = new Regex(@"@([A-Z][a-z]+)\|.*#(\d+)\*");
- Console.WriteLine(reg.Match(text).Groups[1]);
- Console.WriteLine(reg.Match(text).Groups[2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement