-1
我有一個包含HTML的字符串。我想用空格拆分這個字符串,但我不想要HTML。javascript正則表達式與空間和html分割
例如:
scrambled it to make a type specimen book. It <a href="http://php.net/manual/en/function.sprintf.php">http://php.net/manual/en/function.sprintf.php</a> some more text.
分切時與空間的字符串時,它切斷錨標記一半。我想考慮<a>
標籤或<br>
標籤作爲一個單詞。
您是否嘗試過'html'字符串中迭代節點? – guest271314