正则表达式 经常使用的

1、获取中间的那个1(从区块编码中获取报警状态,区块编码格式:传感器编号-报警状态-起始ID)

string str = "080911-1-100104";
var m = Regex.Match(str, "[0-9]+-([0-9]+)-[0-9]+");
return m.Groups[1].Value == "1" ? true : false;
原文地址:https://www.cnblogs.com/guxingy/p/11137060.html