using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\/\*[^*]*\*+([^\/*][^*]*\*+)*\/
";
string input = @"/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
/* @TODO:
- Notes...
*/
/* = = = Set Base Font Size = = = So 1em = 10px / 1.8em = 18px etc */
body { font-size: 62.5% }
body, ul, li {
color: #333333;
font-family: 'Open Sans', verdana, arial, helvetica, helve, sans-serif;
font-weight: 400;
/* font-size: 1.4em; Default font = 14px normal weight Open Sans using #333333 */
line-height: 1.25em;
}
body {
margin: 0; /* Nav bar and footer need to fit edge to edge so no margins! */
padding: 0;
top: 0;
border-bottom: 1px #1C1C1C solid; /* To remove white space under the popup footer */
}
/* = = = Typography = = = */
/* Font choice was carefully considered, Open Sans is very popular so many visitors will already have it cached. */
/* Monda & Shadows into light are also quite popular so may be cached too */
/* = = = Headings = = = */
h1, h2, h3, h4, h5, h6 {
font-family: 'Monda', 'Trebuchet MS', verdana, arial, helvetica, helve, sans-serif;
font-weight: 400;
line-height: 1.2em;
letter-spacing: 1px;
color: #333333;
margin-top: 10px;
margin-bottom: 20px;
}
";
foreach (Match m in Regex.Matches(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