PHP の preg_replace 関数で使用する適切なパターンがわかりません。これは phpBB フォーラムの BBCode の例です。
[color=black][font=Times New Roman][color=black]Thanks. As discussed last night/this morning, we were able to Cable and provide some small relief. After enough waste water was evacuated, the camera diagnosis found at 30 foot from clean-out, heavy root penetration and possible damage/separation to the line. We don’t want to throw a cost to fix/repair without a second opinion from xxx. We will have solid cost of repair later today of first thin in the morning. [/color][/font][/color]
テキストに埋め込まれている可能性のある開始フォントタグと終了フォントタグをいくつでも削除したいのですが、その間にテキストを入れておきます。この場合、私は次のようになりたいと思います:
[color=black][color=black]Thanks. As discussed last night/this morning, we were able to Cable and provide some small relief. After enough waste water was evacuated, the camera diagnosis found at 30 foot from clean-out, heavy root penetration and possible damage/separation to the line. We don’t want to throw a cost to fix/repair without a second opinion from xxx. We will have solid cost of repair later today of first thin in the morning. [/color][/color]
フォントの名前はさまざまで、名前にスペースが含まれているものと含まれていないものがあります。パターンマッチは関係なく機能する必要があります。
前もって感謝します!