Troubleshoot Common Issues While Designing the TestsHandling Complex Regex Patterns in Node Configuration settings

Handling Complex Regex Patterns in Node Configuration settings

Use min_length and max_length in Business Rules to handle complex regex patterns and generate accurate boundary values in node configuration.

Complex Regex Patterns in Node Configuration

Issue: Handling complex regular expressions (regex) creates limitations in generating accurate boundary values (input values) within the system. For example, a complex regex pattern such as:

/^(?!.\{73})(?=.\{8})(?=.\[a-z])(?=.\[A-Z])(?=.\[^(?=.\{8,})(?=.\[a-z])(?=.\[A-Z])(?=.\[ @#₹¥''""£€¢∞§¶•ªº¡™$%\~&^:;'"/,.?=|\<>()\&#123;}\[]!+-]).$/

can be difficult to manage when you need to specify precise length boundaries for input values.

Resolution: As a best practice, use the min_length (minimum length) and max_length (maximum length) options available in the Business Rules section of the node configuration. These options allow you to specify the minimum and maximum lengths for alphanumeric and alphabet patterns, addressing the limitations associated with handling complex regex patterns. By using min_length and max_length, you can ensure accurate and manageable boundary values for regex patterns.

The boundary values ensure that the input adheres to specific length restrictions, preventing it from being too short or too long based on the system's requirements. For example, if a password must be between 8 and 20 characters long, you can set the boundary values accordingly. In the regex pattern, replace the \{8\} part with \{min_length, max_length\}:

/^(?!.\{73})(?=.\&#123;min_length,max_length})(?=.\[a-z])(?=.\[A-Z])(?=.\[^(?=.\{minLength,})(?=.\[a-z])(?=.\[A-Z])(?=.\[ @#₹¥''""£€¢∞§¶•ªº¡™$%\~&^:;'"/,.?=|\<>()\&#123;}\[]!+-]).$/

Replace min_length and max_length with your desired values. For example, with a range of 8 to 20 characters:

/^(?!.\{73})(?=.\{8,20})(?=.\[a-z])(?=.\[A-Z])(?=.\[^(?=.\{8,})(?=.\[a-z])(?=.\[A-Z])(?=.\[ @#₹¥''""£€¢∞§¶•ªº¡™$%\~&^:;'"/,.?=|\<>()\&#123;}\[]!+-]).$/

In this adjusted regex, the pattern .\{8,20} sets the boundary values and ensures that the string length falls within a range of 8 to 20 characters. You can adjust other parts of the regex based on your specific requirements.

Use Business Rules length settings when the main requirement is minimum and maximum input length. This approach is easier to maintain than encoding length rules entirely inside a complex regex.

Accessing Business Rules in Node Configuration

Use the Business Rules window to define the length constraints for your node configuration.

Open the Main canvas

Navigate to the Main canvas where your node is available.

Open the node configuration

In the node configuration process, double-click the node to open the palette window, then click Edit.

Open the feature rules editor

In the Node Configuration window, click the Edit icon next to the feature for which you want to add rules.

Open Business Rules

The Control List Panel window appears. Click the Business Rules button to access the Business Rules window.