0
「Please .... {@@ url}何か{@@ test} somethinng ... some {@@ url} ....」のような文字列があります。正確に文字列を置き換える{@@ URL}とC#正規表現でCの特定の単語を置き換えます。
で正規表現による{@@テストは}親切に私が事前に正規表現パターンに
感謝を取得するために役立ちます!
「Please .... {@@ url}何か{@@ test} somethinng ... some {@@ url} ....」のような文字列があります。正確に文字列を置き換える{@@ URL}とC#正規表現でCの特定の単語を置き換えます。
で正規表現による{@@テストは}親切に私が事前に正規表現パターンに
感謝を取得するために役立ちます!
Regex to get string between curly braces "{I want what's between the curly braces}"
https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx
のでrefrencesため
string pattern = @"/{(.*?)}/";
string input = "Please .... {@@url} something{@@test}somethinng ... some{@@url} ....";
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(input);
if (matches.Count > 0)
{
Console.WriteLine("{0} ({1} matches):", input, matches.Count);
foreach (Match match in matches)
input = input.replace(match.value, "");
}
おかげスチュワートのようなもの –