diff --git a/Protocol/Legacy/ProtocolChecks.cs b/Protocol/Legacy/ProtocolChecks.cs index 1341e59..3fbeee3 100644 --- a/Protocol/Legacy/ProtocolChecks.cs +++ b/Protocol/Legacy/ProtocolChecks.cs @@ -1745,7 +1745,7 @@ public List CheckTrendAlarm(XmlDocument xDoc) // M /// The namespace. private void CheckActionAttributes(XmlDocument xDoc, List resultMsg, XmlNamespaceManager xmlNsm) { - string[] operators = { "<", ">", "==", "<=", ">=", "!=", "<", ">", "<=", ">=" }; + string[] operators = { "<", ">", "==", "<=", ">=", "!=", "<", ">", "<=", ">=", "regex" }; // Action.On => done in CheckResponsePairGroup // Action.Type options: semicolon separated. @@ -1957,6 +1957,16 @@ private void CheckActionAttributes(XmlDocument xDoc, List res }); } + // pid is allowed to be empty when the regex attribute is used. + bool isRegexOperationWithAttributeValid = op == "regex" + && pid == String.Empty + && xnActionType.Attributes?.GetNamedItem("regex") != null; + + if (isRegexOperationWithAttributeValid) + { + continue; + } + if (Int32.TryParse(pid, out int id)) // Check if value is single number { if (ParameterIdSet.Contains(pid)) { continue; } @@ -2038,6 +2048,16 @@ private void CheckActionAttributes(XmlDocument xDoc, List res }); } + // pid is allowed to be empty when the regex attribute is used. + bool isRegexOperationWithAttributeValid = op == "regex" + && pid == String.Empty + && xnActionType.Attributes?.GetNamedItem("regex") != null; + + if (isRegexOperationWithAttributeValid) + { + continue; + } + if (!ParameterIdSet.Contains(pid)) { resultMsg.Add(new ValidationResult