Handling Complex Regex Patterns in Node Configuration settings

Modified on Wed, 28 Feb 2024 at 07:47 PM


Issue: Handling complex regular expressions (regex) poses limitations in generating accurate boundary values (input values) within the given system. 

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


Resolution: As a best practice, it is recommended to use the min_length (minimum length) and max_length (maximum length) options available in the Business Rules space of the node configuration. This allows for specifying the minimum and maximum lengths for alphanumeric and alphabet patterns, addressing the limitations associated with handling complex regex patterns. By utilizing min_length and max_length, you can ensure accurate and manageable boundary values for regex patterns.

Tip: 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, you have a password, and in the system, it must be set between 8 and 20 characters long. That is setting the boundary values for the length of the password. If your password is too short (less than 8 characters) or too long (more than 20 characters), it won't meet the system's criteria.

In the provided regex pattern, you can specify the minimum and maximum lengths by adjusting the {8} part to {min_length, max_length}.
 /^(?!.{73})(?=.{min_length,max_length})(?=.[a-z])(?=.[A-Z])(?=.[^(?=.{minLength,})(?=.[a-z])(?=.[A-Z])(?=.[\n@#₹¥‘’“”£€¢∞§¶•ªº¡™$%~&^:;'"/\,.?=|<>(){}[]!+-]).$/
Replace min_length and max_length with the desired minimum and maximum lengths for your string. /^(?!.{73})(?=.{8,20})(?=.[a-z])(?=.[A-Z])(?=.[^(?=.{8,})(?=.[a-z])(?=.[A-Z])(?=.[\n@#₹¥‘’“”£€¢∞§¶•ªº¡™$%~&^:;'"/\,.?=|<>(){}[]!+-]).$/
In this adjusted regex, the pattern '.{8,20}'sets the boundary values and ensures that a string length falls within a range of 8 and 20 characters. You can adjust other parts of the regex based on your specific requirements. To access the Configuration settings (Business Rules) window, perform the following:  Navigate to the Main canvas.  In the Node configuration process, double-click on the node to view the palette window > click the Edit button. In the Node Configuration window, click the Edit icon corresponding to the feature for which you wish to add rules. The Control List Panel window appears, and you can access the Business Rules window by clicking the Business Rules button.






Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article