我需要一个正则表达式从此字符串中提取数字 513922 。
检测到错误(513922:无法应用设置。),param d1 = 0.0,d2 = 0.0在操作模式下
答案 0 :(得分:1)
如果你坚持正则表达式:
string source =
"Error detected (513922: settings can not be applied.), param d1=0.0, d2=0.0 in...";
// 513922
string result = Regex.Match(source, @"(?<=\()[0-9]+(?=:)").Value;
// if you want integer representation:
int number = int.Parse(result);