使用Rails 3.2。我想刪除<b>
所有文字和標籤,但我想盡辦法剝去標籤只:刪除特定標籤內的內容
string = "
<p>
<b>Section 1</b>
Everything is good.<br>
<b>Section 2</b>
All is well.
</p>"
string.strip_tags
# => "Section 1 Everthing is good. Section 2 All is well."
我要實現這一點:
"Everthing is good. All is well."
我要補充正則表達式匹配太?
添加'{1}'總是沒用。 – HamZa
好的..不需要..謝謝:) –