Added NrxDebugVisualizer folder
This commit is contained in:
49
NrxDebugVisualizer/TestDebugVisualizer/Program.cs
Normal file
49
NrxDebugVisualizer/TestDebugVisualizer/Program.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
class Example
|
||||
{
|
||||
static void Main()
|
||||
{
|
||||
string text = "One car red car blue car";
|
||||
string pat = @"(\w+)\s+(car)";
|
||||
|
||||
// Instantiate the regular expression object.
|
||||
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
|
||||
|
||||
// Match the regular expression pattern against a text string.
|
||||
Match m = r.Match(text);
|
||||
int matchCount = 0;
|
||||
while (m.Success)
|
||||
{
|
||||
Console.WriteLine("Match" + (++matchCount));
|
||||
for (int i = 1; i <= 2; i++)
|
||||
{
|
||||
Group g = m.Groups[i];
|
||||
Console.WriteLine("Group" + i + "='" + g + "'");
|
||||
CaptureCollection cc = g.Captures;
|
||||
for (int j = 0; j < cc.Count; j++)
|
||||
{
|
||||
Capture c = cc[j];
|
||||
System.Console.WriteLine("Capture" + j + "='" + c + "', Position=" + c.Index);
|
||||
}
|
||||
}
|
||||
m = m.NextMatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
// This example displays the following output:
|
||||
// Match1
|
||||
// Group1='One'
|
||||
// Capture0='One', Position=0
|
||||
// Group2='car'
|
||||
// Capture0='car', Position=4
|
||||
// Match2
|
||||
// Group1='red'
|
||||
// Capture0='red', Position=8
|
||||
// Group2='car'
|
||||
// Capture0='car', Position=12
|
||||
// Match3
|
||||
// Group1='blue'
|
||||
// Capture0='blue', Position=16
|
||||
// Group2='car'
|
||||
// Capture0='car', Position=21
|
||||
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user