using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".+>([^>]+)$";
string input = @"<div><pre style=""font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px""><code style=""font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)""><span><span style=""color:rgb(51,51,51);font-weight:bold"">function</span> <span style=""color:rgb(153,0,0);font-weight:bold"">syntaxHighlighting</span><span>()</span> </span>{
<span style=""color:rgb(51,51,51);font-weight:bold"">var</span> n = <span style=""color:rgb(0,128,128)"">33</span>;
<span style=""color:rgb(51,51,51);font-weight:bold"">var</span> s = <span style=""color:rgb(221,17,68)"">""hello, こんにちは""</span>;
<span style=""color:rgb(0,134,179)"">console</span>.log(s);
}
</code></pre>
";
Match m = Regex.Match(input, pattern);
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