I have a service that is returning a message. That message may be a combination of plain text or an html formatted text.
ex1: "This is a message"
ex2: "<p> This is also a message <p/>"
ex3: "This is also a <strong> message </strong>"
The thing we would like to do is come up with a script that would return as much plain text up until the first tag. So in the examples above:
- would return "This is a message.
- would return ""
- would return "This is also a"
I am not sure what approach is the best to do this. Can i accomplish this using Regex or JS. I know Regex can easily return text between two tags, but what i am looking for is a little different. Thanks in advance for any advice or help.