Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のように、文字列全体に複数のブレークタグがあります。
<br></br>
それらを正規表現に置き換えて、次のようにします。
<br/>
これらのブレーク タグには、常に開始タグと終了タグがあります。
これでできるはず
"a string containing <br></br> <br> </br> <br>".replace(/<br>\W*<\/br>/g, "</br>")