I'm trying to remove all trailing HTML line breaks from a string., e.g. <br>
or <br/>
etc.
So this:
<br /> remove HTML breaks after this string <br/><br><br /><br/><br><br /><br /><br/>
Must become this:
<br /> remove HTML breaks after this string
I checked here:
- Regular expression string matching any number of trailing characters in R
- Remove set of characters if they are trailing characters
What I have so far ([<br\/>|<br>|<br \/>])?
, but that matches all line breaks including spaces
Test it live: https://regex101.com/r/XuWYqx/1
[\w ]+)
` https://regex101.com/r/bvjVlq/1 – Philippe Oct 03 '21 at 14:42