我有这样一句话:
[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.