Data Discovery & Risk Insights 25.3.0 Help Center

# Grammar exclusions

Grammars are used to identify potentially sensitive data in your environment. The grammars built into OpenText Core Data Discovery & Risk Insights identify distinct common types of data and the custom grammars let you identify data that is specific to your company's needs. You can also define patterns that let you exclude specific information from those grammars. Using Lua script patterns, you can define the grammar exclusions at either the grammar rule level or the grammar type level. If you add exclusions to the grammar type, the exclusions are inherited by all grammar rules under the grammar type.

As an example of a grammar exclusion, you want to identify all phone numbers within your data except for internal company phone numbers. You can add an exclusion to the individual country or region-specific grammar rules, add exclusions to the Phone Numbers > World Wide grammar rule, or add exclusions to the Phone Numbers grammar type.

- If all internal company phone numbers follow a single pattern, you can add the exclusion to the Phone Numbers grammar type and the pattern is inherited to all country and region grammar rules under the grammar type. Alternately, you could add the exclusion pattern to the specific country or region grammar rule that has the same syntax as the internal company phone number.

- If internal company phone numbers have varying patterns, you can add all of the necessary exclusions to the Phone Numbers grammar type and the pattern is inherited to all country and region grammar rules under the grammar type. Alternately, you can add all the exclusions to the Phone Numbers > World Wide grammar rule or add an exclusion to each of the country or region grammars rules as appropriate for the pattern of your internal company phone numbers.

TIP: Grammar exclusions are defined using Lua script patterns. For more information about Lua, see the Lua Programming Language website .

To define a grammar exclusion

1. From the primary navigation panel, click Grammars > Manage Grammars.

   The Manage Grammars page opens.

2. Click in the row for the grammar type or grammar rule for which you want to add an exlusion.

   Click the open detail panel icon () and then click EXCLUSIONS.

3. Click EDIT EXCLUSIONS.

   The Exclusions dialog opens.

4. Define and add exclusion patterns.

   1. In the Pattern to add text box, type the Lua pattern for the data you want to and exclude from the selected grammar type or rule.

      Limits: Maximum 1000 characters.

      TIP: To match an identified grammar value exactly, include ^ at the beginning of the pattern and $ at the end.

      Example: Using the internal company phone numbers example, you need to identify your company phone numbers, which have the format (123) 456-nnnn. You also want to exclude variations that may include the country code for the US (+1) and variations that may or may not include spaces and special characters such as a dash or a period.

      To identify phone numbers that match your company's phone number pattern, type the following Lua pattern.

          ^%+?1?[%-%s%.]?%(?123%)?[%-%s%.]?456[%-%s%.]?%d%d%d%d$

      where,

      - `?` means that the preceding is optional.

      - `[%-%s%.]` means dash OR space OR dot

      This Lua pattern matches the following phone number patterns.

      - +1 (123) 456-1111

      - (123) 456-7890

      - +1 123-456-2222

      - 123-4561234

      - 1234564444

      - (123)4560987

      - 123 456 5566

      - 123 4567777

      - 123.456.4567

      - 123 456.9999

   2. When you are satisfied with the defined pattern, click ADD.

      The pattern moves to the Patterns box.

   3. In the Description text box, type a meaningful description for the exclusion.

      Limits: Maximum 250 characters.

   4. Repeat to add more patterns to exclude.

5. Click APPLY.

   The exclusions are added to the selected grammar type or rule.

6. (Optional) If you added the exclusion to an existing grammar type or rule and want to apply the change to associated datasets, re-analyze the necessary datasets.

To edit or remove an exclusion pattern

1. From the primary navigation panel, click Grammars > Manage Grammars.

   The Manage Grammars page opens.

2. Click in the row for the grammar type or grammar rule for which you want to add an exclusion.

   Click the open detail panel icon () and then click EXCLUSIONS.

3. Click EDIT EXCLUSIONS.

   The Exclusions dialog opens.

4. Do one of the following.

   - To edit a pattern added to the Patterns box, click the row for the desired pattern and click EDIT. The pattern moves back to the Pattern to add text box.

     Edit the pattern as desired and then click ADD.

   - To remove a pattern added to the Patterns box, click the row for the desired pattern and click DELETE. The pattern is removed completely.

5. When done editing, click APPLY.

   The exclusions for the selected grammar type or grammar rule are updated.

6. (Optional) If you edited or removed an exclusion for an existing grammar type or rule and want to apply the change to associated datasets, re-analyze the necessary datasets.

Copyright 2019-2025 Open Text
Version 25.3.0 | Last updated August 2025
Connect
Marketplace
Learn
Support portal
Documentation
Contact
Submit or view service request