鑑於像如何獲得文字和某些標籤
"<p> >this line starts with an arrow <br /> this line does not </p>"
或
"<p> >this line starts with an arrow </p> <p> this line does not </p>"
字符串我怎樣才能找到帶箭頭開始和一個div
包圍他們的字裏行間替換文本,使之成爲:
"<p> <div> >this line starts with an arrow </div> <br /> this line does not </p>
你如何定義 「行」? –
與[@ alexcxe's](http://stackoverflow.com/a/24391725/2461379)一起回答,因爲,呃... [我會在這裏留下這個...](http://stackoverflow.com/ a/1732454/2461379) –