The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: OT: Javascript Reg's -> ASP.NET to clean MSWord HTML



What does your VB.Net code look like now?

If you are just looking for "/<\?xml[^>]*>/ig" and
replacing it with "",
then this should work, but it looks like the  js replace routine uses
Perl-like parsing syntax, which I'm not familiar with...


Glenn Sullivan, MCSE+I  MCDBA
David Clark Company Inc.

-----Original Message-----
From: Chris Bond [mailto:chris@xxxxxxx]
Sent: Wednesday, January 28, 2004 11:05 AM
To: ukha_d@yahoogroups.com
Subject: [ukha_d] OT: Javascript Reg's -> ASP.NET to clean MSWord HTML


Right very werid problem trying to cleanup some msword html server
side.  I've found a javascript routinue below but converting it to
asp.net to remove the msword html formating just doenst seem to work.

Tried a number of varients of the ASP.NET syntax but it doesnt do
sod all (im writing in vb.net not c#).

Anybody any ideas?

function cleanWord()
{
var textHtml = radEditor.innerHTML;
textHtml = textHtml.replace(/<\?xml[^>]*>/ig, "");
textHtml = textHtml.replace(/<\/?[a-z]+:[^>]*>/ig, "");
textHtml = textHtml.replace(new RegExp("(<[^>]+) class=[^^>]
*([^>]*>)", "ig"), "$1 $2");
textHtml = textHtml.replace(/(<[^>]+) style="[^"]
*"([^>*>)/ig, "$1 $2");
textHtml = textHtml.replace(/<span[^>]*><\/span[^>*>/ig,
"");
textHtml = textHtml.replace(/<span[^>]*><\/span[^>*>/ig,
"");
textHtml = textHtml.replace(/<span><span>/ig,
"<span>");
textHtml = textHtml.replace(/<\/span><\/span>/ig,
"</span>");
radEditor.innerHTML = textHtml;
}


UK Home Automation Meet 2004 - BOOK NOW!
http://www.ukha2004.com

http://www.automatedhome.co.uk
Post message: ukha_d@yahoogroups.com
Subscribe:  ukha_d-subscribe@yahoogroups.com
Unsubscribe:  ukha_d-unsubscribe@yahoogroups.com
List owner:  ukha_d-owner@yahoogroups.com



Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.