A
Aaron
Here is the code,I am limited the types of html tags(decide to list them all out just in case) it is getting inputted in to a xml node:
Dim strData As String = String.Empty
strData = Regex.Replace(strComments, "</?(?i:abbr|acronym|address|applet|area|base|basefont|bdo|bgsound|big|blink|blockqoute|body|button|caption|center|cite|code|col|colgroup|comment|dd|del|dfn|dir|div|dl|dt|em|
embed|fieldset|font|form|frame|frameset|head|h1|h2|h3|h4|h5|h6|html|iframe|ilayer|img|input|ins|isindex|kbd|keygen|keygen|label|layer|lengend|li|link|listing|map|marquee|menu
|multicol|nextid|noembed|noframes|nolayer|noscript|object|ol|optgroup|option|p|param|plaintext|pre|q|s|samp|script|select|server|small|spacer|span|strike|strong|style|sub|sup|
table|tbody|td|textarea|tfoot|th|thead|title|tr|ul|var|wbr|xmp|)(.|\n)*?>", "", RegexOptions.IgnoreCase)
strData= txtData.Text
.......
"<data>" + Server.HtmlEncode(txtData.Text) + "</data>" + _
......
When I test it still allows all the type of html tags listed up in the regex part in. What am I doing wrong?
TIA
Aaron
Dim strData As String = String.Empty
strData = Regex.Replace(strComments, "</?(?i:abbr|acronym|address|applet|area|base|basefont|bdo|bgsound|big|blink|blockqoute|body|button|caption|center|cite|code|col|colgroup|comment|dd|del|dfn|dir|div|dl|dt|em|
embed|fieldset|font|form|frame|frameset|head|h1|h2|h3|h4|h5|h6|html|iframe|ilayer|img|input|ins|isindex|kbd|keygen|keygen|label|layer|lengend|li|link|listing|map|marquee|menu
|multicol|nextid|noembed|noframes|nolayer|noscript|object|ol|optgroup|option|p|param|plaintext|pre|q|s|samp|script|select|server|small|spacer|span|strike|strong|style|sub|sup|
table|tbody|td|textarea|tfoot|th|thead|title|tr|ul|var|wbr|xmp|)(.|\n)*?>", "", RegexOptions.IgnoreCase)
strData= txtData.Text
.......
"<data>" + Server.HtmlEncode(txtData.Text) + "</data>" + _
......
When I test it still allows all the type of html tags listed up in the regex part in. What am I doing wrong?
TIA
Aaron