如何得到这个字符串文本的数字?
字符串字符串值 = "[3=000][98=000][299=000][120=000][012=000][92=000][93=000][04=000]";
string pattern = "([)([0-2][0-9][0-9])(=)";
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(stringvalue);
if (matches.Count > 0)
{
Console.WriteLine("=== Sonuç ===");
foreach (Match match in matches)
Console.WriteLine("value={0}", match.Value.Replace("[", "").Replace("=", ""));
}
else
{
Console.WriteLine("bulunamdı");
}
是另一个 vay 字符串模式 = "([)([0-2][0-9][0-9])(=)"; 这是模式(不可替换)