私はこのような文を持っています:
[FindThis|foo|bar] with some text between [FindThis|foo|bar]. [FindThis|foo|bar] and some more text.
この文を正規表現で置き換えて、次のようにします。
FindThis with some text between FindThis. FindThis and some more text.
どうすればこれを達成できますか?本当に午前中ずっと試していましたが、私が思いついたのは次のことだけです。
Regex.Replace(myString, @"\[(\w).*\]", "$1");
それは私にだけ与える:
F and some more text.