Regex help

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top