471,349 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Remove Microsoft Word formating (in html doc) - regular expression

I have an html document created through MS Word (save as html).

I would like to find a regular expression that can be used to remove all of
the formatting. Any help would be greatly appreciated.
thx
dave
Jul 21 '05 #1
1 2032
A single expression? That would be pretty darned difficult.

Perhaps a series of transformations, where each one applied an expression
and returned a slightly "better" stream of text than the one before it.
After going through them in sequence, you may get there.

In the past, I've seen folks go at it the other way: to write a simple
engine that would evaluate the stream as though it was a browser, allowing
the simple tags, and replacing the complex ones with simpler ones. I dont'
know if that was better or not, but it worked.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"dave" <da**@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
I have an html document created through MS Word (save as html).

I would like to find a regular expression that can be used to remove all
of
the formatting. Any help would be greatly appreciated.
thx
dave

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Buddy | last post: by
8 posts views Thread by Rajeev Soni | last post: by
reply views Thread by Nitin | last post: by
6 posts views Thread by Ludwig | last post: by
25 posts views Thread by Mike | last post: by
1 post views Thread by Steve B. | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.