私はこのテキストを持っています:
$string = '
And God<WH430> said<WH559>, Behold<WH2009>, I have given<WH5414> you every herb<WH6212>
bearing<WH2232> seed<WH2233>, which <FI>is<Fi> upon the face<WH6440> of all the
earth<WH776>, and every tree<WH6086>, in the which <FI>is<Fi> the fruit<WH6529> of a
tree<WH6086> yielding<WH2232> seed<WH2233>; to you it shall be<WH1961> for meat<WH402>.
<RF>bearing...: Heb. seeding seed<Rf><RF>yielding...: Heb. seeding seed<Rf>';
そして、このコード:
$search = '/<RF>(.*)<Rf>/';
$replace = ' <sup data-tooltip class="has-tip" title="$1"> note </sup>';
$string = preg_replace($search, $replace, $string);
正規表現ですべてのタグを個別に置き換えたいのですが、このコードでは次のようになります。
And God<WH430> said<WH559>, Behold<WH2009>, I have given<WH5414> you every herb<WH6212>
bearing<WH2232> seed<WH2233>, which <FI>is<Fi> upon the face<WH6440> of all the
earth<WH776>, and every tree<WH6086>, in the which <FI>is<Fi> the fruit<WH6529> of a
tree<WH6086> yielding<WH2232> seed<WH2233>; to you it shall be<WH1961> for meat<WH402>.
<sup data-tooltip class="has-tip" title="bearing...: Heb. seeding seed<Rf>
<RF>yielding...: Heb. seeding seed"> note </sup>
つまり、途中のタグを飛び越えて、テキストの最後の最後のタグまで続きます...一部のテクスト...のすべてのインスタンスを個別に置き換えるにはどうすればよいですか?