Regex Class (System.Text.RegularExpressions) | Microsoft Docs
docs.microsoft.com › en-us › dotnetConsole::WriteLine ( " {0} matches found.", matches->Count ); // Report on each match. for each (Match^ match in matches) { String^ word = match->Groups ["word"]->Value; int index = match->Index; Console::WriteLine (" {0} repeated at position {1}", word, index); } } C#. using System; using System.Text.RegularExpressions; public class Test { public static void Main () { // Define a regular expression for repeated words.
C# Regex.Match Examples: Regular Expressions
thedeveloperblog.com › regex-matchMatch m = Regex.Match(input, @"\d+"); // ... Write value. Console.WriteLine(m.Value); } } Output 100. Value, length, index. A Match object, returned by Regex.Match has a Value, Length and Index. These describe the matched text (a substring of the input). Value: This is the matched text, represented as a separate string. This is a substring of the original input.