I am cleaning some HTML strings and would like to remove empty spaces between > and < characters.
This is an example of my string:
<h4>Specifications</h4> <table> <tr> <td>Brand</td> <td>Dell</td> </tr> </table>
I would like to remove those X empty spaces between html tags.
Pretty straight-forward:
>\s+<
# match >
# 1+ whitespaces
# <
This needs to be replaced by ><
, see a demo on regex101.com .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.