using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"Node[^\]\[]*\[[^\]\[]*label=""\{\{(?<SRC>[^{}]*)\}\|(?<NAME>\w+)\s*\[ORD=(?<ORD>\d+)\]\|(?<ID>[^|]*)\|\{(?<DEST>[^{}]*)\}\}""\];";
string input = @"Node0x7fd34984d728:s1 -> Node0x7fd34984d600:d0;
Node0x7fd34984d850 [shape=record,shape=Mrecord,label=""{Register %vreg13|0x7fd34984d850|{<d0>i32}}""];
Node0x7fd34984d978 [shape=record,shape=Mrecord,label=""{{<s0>0|<s1>1}|CopyFromReg [ORD=1]|0x7fd34984d978|{<d0>i32|<d1>ch}}""];
Node0x7fd34984d978:s0 -> Node0x7fd3486095f0:d0[color=blue,style=dashed];
Node0x7fd34984d978:s1 -> Node0x7fd34984d850:d0;
Node0x7fd34984daa0 [shape=record,shape=Mrecord,label=""{Register %vreg14|0x7fd34984daa0|{<d0>i32}}""];
SRC=<s0>0|<s1>1, NAME=CopyFromReg , ID=0x7fd34984d978, DEST=<d0>i32|<d1>ch, ORD=1 ";
RegexOptions options = RegexOptions.IgnorePatternWhitespace;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx