I have this string:
This is sample <p id="short"> the value of short </p> <p id="medium"> the value of medium </p> <p id="large"> the value of large</p>
which I want to break into 3 pieces:
- string before p tags :
this is sample - short :
the value of short - medium:
the value of medium - large:
the value of large
If you don’t mind a non-regex solution (because HTML is not a regular language) you can use this