Skip navigation
Currently Being Moderated

A Find expression to find everything in span tag

Apr 4, 2013 5:27 PM

I imported word doc into my robohelp project and there is a lot of span tag junk i want to get rid of.


Is there an expression i can build in the "find and replace" tool that will find any span tag and its contents?

In the following example I want to delete the whole string including the brackets:


<span style="letter-spacing: .05pt;">


I'm thinking possibly a wildcard like: <span ***>


I don't see a wildcard option in robohelp help related to building find expressions.

  • Currently Being Moderated
    Apr 5, 2013 12:54 AM   in reply to jeffc2010



    Are you using RoboHelp 8 or above? If so, you can use a script for that. (I have one lying around somewhere, let me know if you're interested.)


    If you want to search, don't search for <span, as that will remove span tags you want to retain (styles, expandtexts, etc.) I'm not very comfortable with regular expressions, but Peter might know a fancy regex.


    @Peter: Hello! Can you chime in?





    Mark as:
  • Currently Being Moderated
    Apr 5, 2013 2:32 AM   in reply to Willam van Weelden

    Nasty one this as you cannot search for <span - and all between - and </span> without trashing a lot of stuff that is needed.


    In theory if you have Rh10 you could add a must include but there are two issues there. It sounds like there could be many must includes and there is a bug in the Must Include part of the new Find and Replace in Files so you don't want to use it anyway.


    I'm thinking you want to avoid those tags in the first place. It sounds like the source document has inline formatting that needs to be removed.


    See for RoboHelp and Authoring tips




    Mark as:
  • Currently Being Moderated
    Apr 6, 2013 1:46 AM   in reply to jeffc2010

    Tools that handle regular expressions are not the problem, it's writing the expression that requires the time and skill.


    If you are just looking for everything starting <span and ending </span> you don't need regular expressions, I think Rh's Find and Replace in Files will do it, just don't use the Must Include field and make sure you have a backup of your project.


    Now that we know your version of Rh, apply a style to your tables in Word (create a named style if you have to) and create a table style in Rh. When you import you can map the two and then the table should be good.


    Importing is covered on my site and I think mapping tables is in the Rh9 section of my RoboHelp Tour.


    See for RoboHelp and Authoring tips




    Mark as:
  • Currently Being Moderated
    Apr 8, 2013 11:54 AM   in reply to jeffc2010

    Humour me.


    1. Create a Word document with a table that has a named style applied.
    2. Create a Rh project with a table style given the same name. It does not have to look the same and it might be better if it does not, you will know whether or not the mapping is working.
    3. Import making sure you map the table styles.


    Do you still have unacceptable span tags?


    If the above idea does not solve the problem, give me some examples of your span tags, especially the ones where your expression is not working. I will try to come up with something but it might take a day or two before I can get back to you.


    See for RoboHelp and Authoring tips




    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points