c# Programming Glossary: m.groups
C# Reading a File Line By Line http://stackoverflow.com/questions/1271225/c-sharp-reading-a-file-line-by-line name Match m nameRegex.Match line if m.Success _Name m.Groups 1 .Value remove me when other values are read break c# linq..
Converting Unicode strings to escaped ascii string http://stackoverflow.com/questions/1615559/converting-unicode-strings-to-escaped-ascii-string value @ u Value a zA Z0 9 4 m return char int.Parse m.Groups Value .Value NumberStyles.HexNumber .ToString Outputs This..
What are regular expression Balancing Groups? http://stackoverflow.com/questions/17003799/what-are-regular-expression-balancing-groups like Match m new Regex @ . .Match abcd you will find that m.Groups 1 .Captures Is a CaptureCollection whose elements correspond.. So applying this regex to the input foo bar and inspecting m.Groups word .Captures we find two captures 0 foo 1 bar This allows..
Characters in string changed after downloading HTML from the internet http://stackoverflow.com/questions/2700638/characters-in-string-changed-after-downloading-html-from-the-internet s charset . RegexOptions.IgnoreCase if m.Success charset m.Groups charset .Value.Trim new ' '' ' ' else charset response.CharacterSet.. .Match html if m.Success string charset m.Groups charset .Value.ToLower iso 8859 1 if charset unicode charset..
How does this regex find triangular numbers? http://stackoverflow.com/questions/3627681/how-does-this-regex-find-triangular-numbers .PadLeft n if m.Success Console.WriteLine 0 sum 1.. 1 n m.Groups 1 .Length 1 sum 1..1 3 sum 1..2 6 sum 1..3 10 sum 1..4 15 sum..
Regular expression to remove HTML tags http://stackoverflow.com/questions/3790681/regular-expression-to-remove-html-tags
Aspx to Razor syntax converter? http://stackoverflow.com/questions/4422881/aspx-to-razor-syntax-converter @ s Import Namespace ns . s m defaultNamespaces.Contains m.Groups ns .Value null @using m.Groups ns .Value headers string text3.. defaultNamespaces.Contains m.Groups ns .Value null @using m.Groups ns .Value headers string text3 Regex.Replace text2 @ @ s dir.. headers string text3 Regex.Replace text2 @ @ s dir . m @ m.Groups dir .Value Preserves headers expressions string text4 Regex.Replace..
Regular Expression to split on spaces unless in quotes http://stackoverflow.com/questions/554013/regular-expression-to-split-on-spaces-unless-in-quotes .Matches input @ match w match w s .Cast Match .Select m m.Groups match .Value .ToList .ForEach s Console.WriteLine s share..
Fuzzy Date Time Picker Control in C# .NET? http://stackoverflow.com/questions/887189/fuzzy-date-time-picker-control-in-c-sharp-net @ next 2 9 d months delegate Match m var val int.Parse m.Groups 1 .Value return DateTime.Now.AddMonths val new RegexDateTimePattern.. @ next 2 9 d days delegate Match m var val int.Parse m.Groups 1 .Value return DateTime.Now.AddDays val new RegexDateTimePattern.. @ 2 9 d months ago delegate Match m var val int.Parse m.Groups 1 .Value return DateTime.Now.AddMonths val new RegexDateTimePattern..
Regex: Named Capturing Groups in .NET http://stackoverflow.com/questions/906493/regex-named-capturing-groups-in-net
|