A Regex Rule is used to check the accuracy of a field’s value through a regular expression. A regular expression is a combination of string consisting of characters, operators, and constants to describe a search pattern or condition.
To apply this rule, the field(s) for which the regex works needs to be mentioned. This is followed by a Regular expression for the field.
For example, if the Name field should have the first character as upper case then the field Name would be mentioned followed by the Regex:
^(?:[A-Z!@#$%^&*-.,;:()/1234567890][^\s]*\s?)+$
To configure a Regex Rule within a module:
- Click on the Settings icon at top right corner on the Home page.
- From the left menu bar, select Modules.
- Select the module > Business Rules > Schema.
- Identify the desired schema and click on Detail > Add Business Rule.
- Under Rule Type, check Regex Rule radio button.
- Click Next.
- Enter the name of the rule in Description.
- Select the preferred Category for the rule.
- In Fields, select the field(s) that need to be assigned the regex rule.
- In case the system already has a Standard function, select from a list of Standard functions. The Regular expression will get populated.
- If there is no standard function already defined, write the regular expression.
- Write the desired Message in case the regular expression condition fails.
- Select Finish.