Remove everything except question mark RRS feed

  • Question

  • Hello,

    I have the following html pattern: <td><b>Where</b></td><br><br>

    In the above pattern, the string Where could be substituted with any number of words (including multiple words: Program Name).

    I am able to locate that html pattern by using the following regex expression: .*

    There are instances where strings enclosed within the html tags include a question mark (?) such as in this:

    <td><b>How old are you ?</b></td><br><br>.

    Can anyone help me with identifying these patterns ?

    I have built a function that remove identified patterns but in this scenario, I would like all string within the above html tags removes except when they contain a question mark.

    My function looks something like this: myFunction(pattern,replacementstring,originalstring)

    Running the following: myFunction(.*,'',myString) should return an empty space ('')

    What would be the regex if I want to replace everything but leave the string alone if it ending with a question mark (?)

    Thank you

    Wednesday, March 28, 2018 12:54 PM

All replies