【发布时间】:2012-10-02 06:16:23
【问题描述】:
const string numericReg = "\\d+"; // Matches a digit character. Equivalent to [0-9].
const string realNumsReg = numericReg + b + "(\\." + b + numericReg + ")?";
const string b = "\\s*";
这句话是真的:
private const string rte = "(?<rate>" + realNumsReg + ")" +
"(?=(?<rte1>" + b + "qs " + "))";
和
这句话是真的:
private const string barl = "(?<barl>" + numericReg + ")" +
"(?=((?<q>" + b + "point to print )))";
rte 是这样:
MatchCollection s = Regex.Matches
("3000 qs / min", rte , RegexOptions.IgnoreCase);
barl 也是这样:
MatchCollection s = Regex.Matches
("6 point to print ", barl , RegexOptions.IgnoreCase);
为什么会这样?
MatchCollection s = Regex.Matches
("6 point to print 3000 qs/ min", barl+b+rte , RegexOptions.IgnoreCase);
【问题讨论】: