diff --git a/src/features/dfdElements/outputPortBehaviorValidation.ts b/src/features/dfdElements/outputPortBehaviorValidation.ts index 46b5bc6..4769468 100644 --- a/src/features/dfdElements/outputPortBehaviorValidation.ts +++ b/src/features/dfdElements/outputPortBehaviorValidation.ts @@ -23,16 +23,15 @@ export class PortBehaviorValidator { // Regex that validates assignments // Matches "Assignment({input_Pins};Term;{out_Label})" private static readonly ASSIGNMENT_REGEX = - /^Assignment\(\{(([A-Za-z0-9_\|]+(,\s*[A-Za-z0-9_\|]+)*)?)\};(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z][A-Za-z0-9_]*\.[A-Za-z][A-Za-z0-9_]*))+;\{(((([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*))+(,\s*(([A-Za-z][A-Za-z0-9_\|]*)\.([A-Za-z][A-Za-z0-9_\|]*)))*)?)\}\)+$/; + /^Assignment\(\{(([A-Za-z0-9_\|]+(,\s*[A-Za-z0-9_\|]+)*)?)\};(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z0-9_]*\.[A-Za-z0-9_]*))+;\{(((([A-Za-z0-9_\|]*)\.[A-Za-z0-9_\|]*)+(,\s*([A-Za-z0-9_\|]*\.[A-Za-z0-9_\|]*))*)?)\}\)+$/; // Regex that validates forwarding // Matches "Forwarding({input_pins})" private static readonly FORWARDING_REGEX = /^Forwarding\(\{[A-Za-z0-9_\|]+(,\s*[A-Za-z0-9_\|]+)*\}\)$/; // Regex that validates a term - // Matches Constants, Operants and Label References - private static readonly TERM_REGEX = - /^(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z][A-Za-z0-9_]*\.[A-Za-z][A-Za-z0-9_]*))+$/; + // Has the label type and label value that should be set as capturing groups. + private static readonly TERM_REGEX = /^(\s*|!|TRUE|FALSE|\|\||&&|\(|\)|([A-Za-z0-9_]*\.[A-Za-z0-9_]*))+$/; // Regex matching alphanumeric characters. public static readonly REGEX_ALPHANUMERIC = /[A-Za-z0-9_\|]+/;