Solution Title: Regular Expressions to remove or replace
Author: pmengal
Points: 500   Grade: A
Date: 05/12/2003 01:18AM PDT


Sorry to be so complete, but I posted some 500 and 250 questions and got incomplete answers due to the non complete enough question.

Thanks in advance !
Comment from pmengal
Date: 05/12/2003 01:19AM PDT
Author Comment

website to learn is welcome ;)

Comment from AvonWyss
Date: 05/12/2003 05:22AM PDT
Comment

I will.... stay tuned.

Comment from testn
Date: 05/12/2003 06:37AM PDT
Comment

http://www.amazon.com/exec/obidos/tg/detail/-/B0000632ZU/102-4200309-1247344?vi=glance


Accepted Answer from testn
Date: 05/12/2003 06:42AM PDT
Accepted Answer

                return newStr;
}

This function will return the string that contains no malicious code.

Comment from testn
Date: 05/12/2003 06:47AM PDT
Comment


Comment from testn
Date: 05/12/2003 07:22AM PDT
Comment


to

Hello

since .*? mean non-greedy matching it will try to match up least possible characters of the pattern

Comment from testn
Date: 05/12/2003 07:33AM PDT
Comment

Please also keep testing when this applies to multiple lines data

You might need to change it to

<script[^>]*>(\w|\W)*?</script[^>]*>

or to

(?m)<script[^>]*>(\w|\W)*?</script[^>]*>

Comment from AvonWyss
Date: 05/12/2003 09:39PM PDT
Comment

          }


This Regex will do both your tasks and at the same time. The first part is pretty similar to testn's suggestion, but I also provide the code to find single > chars (with no matching < before).

Comment from osxmaster
Date: 02/23/2004 02:19PM PST
Comment

http://www.wipo.org

Seems to be very complicated.

thanks

Comment from AvonWyss
Date: 02/24/2004 09:59PM PST
Comment

http:Q_20892954.html

Or you can of course also post a new Q.

From:http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20613142.html#8508997

相关文章: