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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dave

    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
  • Nick Malik [Microsoft]

    #2
    Re: Remove Microsoft Word formating (in html doc) - regular expression

    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


    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" <dave@discussio ns.microsoft.co m> wrote in message
    news:BD97C474-C847-466F-BE39-ADCC61FBA01E@mi crosoft.com...[color=blue]
    >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[/color]


    Comment

    Working...