Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SMS filter config Captures and Groups
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { private static readonly Regex configValueExtrator = new Regex(@"(?:restrict=)(true|false)\|?(?:recipients=)(?:,?(\+?\d{8,10}))*"); private static readonly string config = "restrict=true|recipients=48995764,97063710"; public static void Main(string[] args) { var matches = configValueExtrator.Matches(config); foreach(Match match in matches){ Console.WriteLine("**MATCH**"); Console.WriteLine(match.Value); foreach(Group grp in match.Groups){ Console.WriteLine("\t**GROUP**"); Console.WriteLine("\t{0}", grp.Value); foreach(Capture capture in grp.Captures){ Console.WriteLine("\t\t**Capture**"); Console.WriteLine("\t\t{0}", capture.Value); } } } } } }
run
|
edit
|
history
|
help
0
Date Comparison
1
code
Pyramid
comparer implementation
Uri Parts
My First Hello world
xyz
TrzyKreski
Finally statement called after return