#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2008
    Location
    UK
    Posts
    16
    Rep Power
    0

    Stripping class from HTML tags


    HI all,

    I'm surprised this didn't come up in my search results, as I thought this would be a common question. I use openoffice to create documents, and I want to save time in producing an html version which will go on a CMS. As most will probably guess, the HTML openoffice exports is pretty poop, and I want to clean it up.

    All I want is simple html tags, eg

    <h1> instead of <h1 class="P12"> and <p> instead of <p class="P3">

    I don't know regex or preg_replace but I know it can do what I want.
    Can anyone help?
  2. #2
  3. No Profile Picture
    User 165270
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    497
    Rep Power
    937
    Originally Posted by ICEcoffee
    ...

    I don't know regex or preg_replace but I know it can do what I want.
    Can anyone help?
    Sure, this is an excellent starting point:
    http://www.regular-expressions.info/tutorial.html

IMN logo majestic logo threadwatch logo seochat tools logo