using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".journal-bg {[^{]*(?<bc>background-color.*;)[^{]*}";
string input = @"sadf
.journal-bg {
background-color: #112021;
background: #184E3B #154a47;
background: -moz-linear-gradient(top, #154a47 0%, #598238 100%);
background: -webkit-linear-gradient(top, #154a47 0%, #598238 100%);
background: linear-gradient(to bottom, #154a47 0%, #598238 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#154a47', endColorstr='#598238', GradientType=0 );
border-bottom: 3px solid #F7EF8F;
}";
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