I have a large html file, I want to remove anything between the <trimweb> tags, even if the contents is on multiple lines. There is a regex option called RegexOptions.MultiLine which I though would work, but its actually the RegexOptions.Singleline below what makes it span multiple lines, see http://msdn.microsoft.com/en-us/library/ms972966.aspx for details on RegexOptions.Singleline.
Dim reg As New Regex(".*?", RegexOptions.Singleline Or RegexOptions.IgnoreCase) lblSurvey.Text = reg.Replace(lblSurvey.Text, "")
Dim search As String = Nothing Dim replace As String = Nothing For Each drTD As DataRow In dsTemplateDetail.Tables(0).Rows search = "{{" & drTD.Item("TemplateObjectType").ToString & "ID:" & drTD.Item("TemplateObjectID").ToString & "}}" If drTD.Item("TemplateObjectType").ToString.ToLower = "image" Then replace = "" Else replace = drTD.Item("TemplateObjectData").ToString End If templateHtml = templateHtml.Replace(search, replace) Next 'Search/Replace Client-Side Scripts search = "name='_rad" : replace = "onclick='click_answer()' name='_rad" : templateHtml = templateHtml.Replace(search, replace) search = "name=""_rad" : replace = "onclick='click_answer()' name=""_rad" : templateHtml = templateHtml.Replace(search, replace) search = "name='_chk" : replace = "onclick='click_answer()' name='_chk" : templateHtml = templateHtml.Replace(search, replace) search = "name=""_chk" : replace = "onclick='click_answer()' name=""_chk" : templateHtml = templateHtml.Replace(search, replace) 'Remove any ... tags Dim reg As New Regex(".*?", RegexOptions.Singleline Or RegexOptions.IgnoreCase) templateHtml = reg.Replace(templateHtml, "")