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


  • To: ukha_d@xxxxxxx
  • Subject: Re: OT: Javascript Reg's -> ASP.NET to clean MSWord HTML
  • From: "Chris Bond" <chris@xxxxxxx>
  • Date: Wed, 28 Jan 2004 17:03:17 -0000
  • Mailing-list: list ukha_d@yahoogroups.com; contact ukha_d-owner@xxxxxxx
  • Reply-to: ukha_d@xxxxxxx

> 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...


Private Function CleanHtml(ByVal strHtml As String) As String
Dim strTemp As String
strTemp = Regex.Replace(strHtml, "/<\?xml[^>]*>/ig",
"")
strTemp = Regex.Replace(strTemp,
"/<\/?[a-z]+:[^>]*>/ig", "")
'// Missing 1
'// Missing 2
strTemp = Regex.Replace(strTemp,
"/<span[^>]*><\/span[^>]
*>/ig", "")
strTemp = Regex.Replace(strTemp,
"/<span[^>]*><\/span[^>]
*>/ig", "")
strTemp = Regex.Replace
(strTemp, "/<span><span>/ig",
"<span>")
strTemp = Regex.Replace
(strTemp, "/<\/span><\/span>/ig",
"</span>")
Return strTemp
End Function

Oblessly that isnt working properly though.


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.