I have following html string and I want to add space after all tags like </strong> where space is missing, only inside body. If there is a space already, extra space should not be added.
<html><head><title>test</title></head><body>This <strong>Super</strong> subject can be <strong>super</strong>test into object</body></html>
This should get converted to following:
<html><head><title>test</title></head><body>This <strong>Super</strong> subject can be <strong>super</strong> test into object</body></html>
Is this doable using regex? Can you help me with the regex?
s = s.replaceAll("(?<=</strong>)(?! )", " ")--- See demo