using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"<\!--\[if\s+lt\s+IE\s+\d][^>]*>(.*)<\!\[endif\]-->";
string input = @"
rwerwerw
<!--[if lt IE 9]>
<script src=""https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js""></script>
<script src=""https://oss.maxcdn.com/respond/1.4.2/respond.min.js""></script>
<![endif]-->
rwerwerwerwe
<script type=""text/javascript"">
jQuery(window).on('load', function() {
new JCaption('img.caption');
});
if (typeof RokBoxSettings == 'undefined') RokBoxSettings = {pc: '100'};
jQuery(document).ready(function()
{
jQuery('.hasTooltip').tooltip({""html"": true,""container"": ""body""});
});
jQuery(document).ready(function (){
jQuery('.minicolors').each(function() {
jQuery(this).minicolors({
control: jQuery(this).attr('data-control') || 'hue',
position: jQuery(this).attr('data-position') || 'right',
theme: 'bootstrap'
});
});
});
jQuery(function(){
new JVMenu('#',{
main: {
delay: 300,
duration: 300,
effect: 'fade',
easing: 'linear'
},
sub: {
delay: 300,
duration: 300,
effect: 'slide',
easing: 'linear'
},
responsive: 992
});
})
jQuery(function(){new JVTop();});
jQuery(function($){ });
</script>
<!--[if lt IE 9]>
<script src=""https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js""></script>
<script src=""https://oss.maxcdn.com/respond/1.4.2/respond.min.js""></script>
<![endif]-->
";
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline;
Match m = Regex.Match(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