1

私はこの表現の反対を取得しようとしていますが、それは私にいくつかの問題を与えています。

元。

expression: (?<={{)(.*?)(?=}})
string: this is a question with a textbox {{textbox}} ok
results: textbox

のようなものを探しています

expression: !(?<={{)(.*?)(?=}})
string:this is a question with a textbox {{textbox}} ok 
results: this is a question with a textbox ok

また、{{}}の内容は必ずしもテキストボックスではなく、ランダムなアルファベット文字になることに注意してください。

4

1 に答える 1

1

交換はどうですか?

string replaced = yourRegex.Replace(original, string.Empty);

replacedあなたの「マッチ」になります。そして、アサーションももう必要ありません。

于 2013-03-01T21:26:25.300 に答える