PDA

View Full Version : removing quotes inside html tags


Dan
01-19-2001, 12:55 PM
im trying to turn something like <a href="file.asp">file</a> to <a href=file.asp>file</a><BR><BR>my regexp skills arent up to par, heres how i did it:<BR><BR>set o_regexp = new RegExp<BR> o_regexp.ignorecase=true<BR> o_regexp.global=true<BR> o_regexp.pattern="<.*(" & chr(34) & ")>"<BR> set o_matches=o_regexp.execute(str)<BR> if o_matches.count>0then<BR> for each o_match in o_matches<BR> str=replace(str,o_match.value,replace(o_match.valu e,chr(34),""))<BR> next<BR> end if<BR>set o_regexp=nothing<BR><BR><BR>im sure theres a much better way to do this, any suggestions?

Sachin
02-03-2001, 04:07 AM
I am giving an example to remove single quote<BR>dim rs<BR>rs="<hello th'ee inside'dff>"<BR>rs=replace(rs,"'","",1)<BR>Response.Write rs

Dan
03-08-2001, 07:50 PM
but that doesnt work if the string is "<hell th'ee> i'm here"