PDA

View Full Version : Remove HTML with special characters


lebronletchev
08-15-2010, 05:46 PM
Hi,

There is a lot of scripts to remove html tags (I have one), however I would need one that take into account the special characters (Spanish and French languages): á, é, é, ó, ú, ç, ñ etc.

Does someone know where to find an Asp 3.0 code to remove html tags with special characters remaining the original special character? á, é, é, ó, ú, ç, ñ etc.

Best regards

LeTchev:D

Old Pedant
08-15-2010, 09:53 PM
I don't understand why any good removal code would *touch* those characters.


<%
text = "<a href=""#""><b>á, é, é, ó, ú, ç, ñ etc.</b></a><hr>"

Response.Write text

Set reZap = New RegExp
reZap.Pattern = "\<\/?[a-zA-Z][^\>]*\>"
reZap.Global = True

nohtml = reZap.Replace(text,"")

Response.Write nohtml
%>