473,386 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 2109
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: someone | last post by:
hi A friend just sent me a text translation in norwegian, that she saved with WORD 9, as an html file It's loaded with Microsoft code like this : <p class=MsoNormal><span...
4
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following...
8
by: Rajeev Soni | last post by:
Hi I am looking for the regular expression for validating the allowed file types to upload like files like "zip,pdf,doc,rtf,gif,jpg,png,txt"; and the expression should not be case sensitive like...
0
by: Nitin | last post by:
How can I create and use Tables in Microsoft word document through VB .net? I've been using the following code for printing an envelope using paragraphs. Tables have to be used for better...
1
by: dave | last post by:
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....
6
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
1
by: Steve B. | last post by:
Hi, I'm building a web site that can render html from various user input. The problem is that the html cannot be trusted, so I need to ensure it does not contain script attack injection. That's...
0
by: Umakanth Madich | last post by:
I want to edit the existing word processing ML doc. But I dont know how they have created that doc. Please see the attachment for reference. How to ctreate it from scratch?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.