Click here to Skip to main content
15,902,492 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: format a decimal number Pin
_AK_31-Jul-06 20:13
_AK_31-Jul-06 20:13 
GeneralRe: format a decimal number Pin
Vipin Venugopal31-Jul-06 20:20
Vipin Venugopal31-Jul-06 20:20 
GeneralRe: format a decimal number Pin
coolpali_girl31-Jul-06 21:21
coolpali_girl31-Jul-06 21:21 
QuestionNeed the regular expression to filter HTML tags in ASP.NET Pin
Exelioindia31-Jul-06 18:30
Exelioindia31-Jul-06 18:30 
AnswerRe: Need the regular expression to filter HTML tags in ASP.NET Pin
Guffa31-Jul-06 19:15
Guffa31-Jul-06 19:15 
GeneralRe: Need the regular expression to filter HTML tags in ASP.NET Pin
Exelioindia31-Jul-06 20:18
Exelioindia31-Jul-06 20:18 
GeneralNeed the regular expression to filter HTML tags in ASP.NET Pin
Exelioindia1-Aug-06 20:15
Exelioindia1-Aug-06 20:15 
GeneralRe: Need the regular expression to filter HTML tags in ASP.NET Pin
Guffa2-Aug-06 0:00
Guffa2-Aug-06 0:00 
From your attempts it looks like you are just guessing, wihtout knowing what the expression does.

This is what the expression contains:

< matches the starting angle of a tag.
[^>] is a set that matches any character that is not an ending angle.
+ means that the previous expression should be matched one or more times.
? means that the match should be non-gready, e.g. match as little as possible.
> matches the ending angle of a tag.

When you put [^<b>>] in the set, it doesn't exclude the bold tag, it excludes the characters "b", "<" and ">". If you for an example would have a <table> tag, it would not be matched as it contains a "b".

To match certain tags, you would have to catch the specific tags you want to keep, and see to that they weren't replaced. Perhaps something like:

.Replace("()|(?:<[^>]+?>)", "$1");

If that doesn't work, you could use a delegate in the replace, and in the delegate method examine the text that is replaced to determine if it should be removed or not.


---
b { font-weight: normal; }

GeneralRe: Need the regular expression to filter HTML tags in ASP.NET Pin
Exelioindia2-Aug-06 0:36
Exelioindia2-Aug-06 0:36 
QuestionHow to code minimize button Pin
jagmit2031-Jul-06 18:25
jagmit2031-Jul-06 18:25 
AnswerRe: How to code minimize button [modified] Pin
Guffa31-Jul-06 19:11
Guffa31-Jul-06 19:11 
AnswerRe: How to code minimize button Pin
mbbisht31-Jul-06 20:29
mbbisht31-Jul-06 20:29 
Questionschedule task by the interval of day,month,year Pin
mbbisht31-Jul-06 17:53
mbbisht31-Jul-06 17:53 
AnswerRe: schedule task by the interval of day,month,year Pin
mnaveed1-Aug-06 0:45
mnaveed1-Aug-06 0:45 
Questioncheckbox in Infragistic webgrid Pin
walsudani31-Jul-06 16:13
walsudani31-Jul-06 16:13 
Questionextracting url in asp.net Pin
porsche996turbo31-Jul-06 16:10
porsche996turbo31-Jul-06 16:10 
AnswerRe: extracting url in asp.net Pin
mbbisht31-Jul-06 18:13
mbbisht31-Jul-06 18:13 
AnswerRe: extracting url in asp.net Pin
Khawar Abbas131-Jul-06 20:48
Khawar Abbas131-Jul-06 20:48 
QuestionDynamic custom validator at server? Pin
Member 9631-Jul-06 16:07
Member 9631-Jul-06 16:07 
AnswerRe: Dynamic custom validator at server? Pin
Tim Kohler31-Jul-06 19:08
Tim Kohler31-Jul-06 19:08 
GeneralRe: Dynamic custom validator at server? Pin
Member 961-Aug-06 6:50
Member 961-Aug-06 6:50 
QuestionHow to insert data into database Pin
ypsyong31-Jul-06 15:32
ypsyong31-Jul-06 15:32 
AnswerRe: How to insert data into database Pin
Vipin Venugopal31-Jul-06 19:07
Vipin Venugopal31-Jul-06 19:07 
AnswerRe: How to insert data into database [modified] Pin
JustForLive1-Aug-06 0:04
JustForLive1-Aug-06 0:04 
QuestionTreeView Pin
smarttom9931-Jul-06 14:23
smarttom9931-Jul-06 14:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.