私は正規表現の問題に閉じ込められています。大きな文字列に沿って、文字列の両側に「< strong>」および「< /strong>」タグを配置する必要があります。たとえば、私が持っている場合:
"This is a test, and test word appears two times"
選択された文字列は「test」であり、そのまま残ります。
"This is a <_strong>test<_/strong>, and <_strong>test<_/strong> word appears two times"
最初は、「ReplacedAll」と組み合わせて正規表現関数を使用していると思います。問題は、より大きな文字列に <_strong> タグがある場合に発生します。次のようなものがあります。
"This is a test, and <_strong>test word<_/strong> appears two times"
それはそのようなもののままです:
"This is a <_strong>test<_/strong>, and <_strong><_strong>test<_/strong> word<_/strong> appears two times"
アイデアは、 <_strong> タグの間にない場合にのみ、文字列「test」を変更する正規表現を見つけることです。しかし、私はそれを見つけることができません。