Managing regex-based custom entity types

Required global permission - either:

  • Create custom entity types

  • Edit any custom entity type

A regex-based custom entity type uses one or more regular expressions to identify values of that type. If a value matches a configured regular expression for the custom entity type, then it is identified as that entity type.

Regex-based custom entity types are useful when the entity values have a standard format. For example, to detect an identifier that is specific to your organization, and that always uses the same format, you could create a regex-based custom entity type.

For a more varied set of values that does not conform to one or a few formats, and that rely more on context, you would instead create a model-based custom entity type.

Creating, editing, and deleting a regex-based custom entity type

Creating a regex-based custom entity type

Required global permission: Create custom entity types

To create a regex-based custom entity type, on the Custom Entity Types page:

  1. Click Create Custom Entity Type.

  2. In the dropdown, click Regex-based entity type.

Custom entity type creation dropdown

After you configure the entity type:

Details panel for a regex-based custom entity type
  • To save the new type, but not scan dataset files for the new type, click Save Without Scanning Files.

  • To both save the new type and scan for it, click Save and Scan Files.

To detect new custom entity types in a dataset, Textual needs to run a scan. If you do not run the scan when you save the custom entity type, then on the dataset details page, you are prompted to run a scan.

Editing a regex-based custom entity type

Required global permission: You can edit any custom entity type that you create.

Users with the global permission Edit any custom entity type can edit any custom entity type.

To edit a custom entity type, in the regex-based entity types list, click the edit icon for the entity type.

You can also edit a regex-based custom entity type from the dataset details page.

For an existing entity type, you can change the description, the regular expressions, and the enabled datasets.

You cannot change the entity type name, which is used to produce the identifier to use to configure the entity type handling from the SDK.

After you update the configuration:

  • To save the changes, but not scan dataset files based on the updated configuration, click Save Without Scanning Files.

  • To both save the new type and scan based on the updated configuration, click Save and Scan Files.

To reflect the changes to custom entity types in a dataset, Textual needs to run a scan. If you do not run the scan when you save the changes, then on the dataset details page, you are prompted to run a scan.

Deleting a regex-based custom entity type

When you delete a custom entity type, it is removed from the datasets that it was active for.

To delete a custom entity type:

  1. In the custom entity types list, click the delete icon for the entity type.

  2. On the confirmation panel, click Delete Entity Type.

Configuration settings for regex-based custom entity types

The configuration for a regex-based custom entity type includes:

  • Name and description

  • Regular expressions to identify matching values. From the configuration panel, you can test the expressions against text that you provide.

  • Datasets to make the entity type active for. You can also enable and disable custom entity types from the dataset details pages.

Name and description

In the Name field, provide a name for the entity type. Each custom entity type name:

  • Must be unique within an organization.

  • Can only contain alphanumeric characters and spaces. Custom entity type names cannot contain punctuation or other special characters.

After you save the entity type, you cannot change the name. Textual uses the name as the basis for the identifier that you use to refer to the entity type in the SDK.

In the Description field, provide a longer description of the custom entity type.

Regular expressions to identify matching values

Under Keywords, Phrases, or Regexes, provide expressions to identify matching values for the entity type.

Regular expressions list for a custom entity type

An entry can be as simple as a single word or phrase, or you can provide a more complex regular expression to identify the values.

Textual maintains an empty row at the bottom of the list. When you type an expression into the last row, Textual adds a new empty row.

To add an entry, begin to type the value in the empty row.

To edit an entry, click the entry field, then edit the value.

To remove an entry, click its delete icon.

Testing an expression

Under Test Entry, you can check whether Textual correctly identifies a value as the entity type based on the provided expression.

To test an expression:

  1. From the dropdown list, select the entry to test.

Dropdown list to select the regular expression to test
  1. In the text area, provide the text to test.

As you enter the text, Textual automatically scans the text for matches to the selected expression. The Result field displays the input text and highlights the matching values.

Test results for a custom entity type regular expression

Enabling and disabling the regex-based entity type for datasets and guided redaction projects

Under Activate Custom Entity Type, you identify the datasets and guided redaction projects to make the entity active for.

From the dataset details and guided redaction details, you can also enable and disable custom entity types for that dataset or guided redaction project.

Activate Custom Entity Type section to select the datasets and guided redaction projects that include the custom entity type

To make the entity active for all current and future datasets and guided redaction projects, check Automatically activate for all current, and new datasets and guided redaction projects.

The rest of the panel is split into separate lists for datasets and guided redaction projects.

For each list:

  • To make the entity active for a specific dataset or guided redaction project, set the toggle for the dataset or project to the on position.

  • To filter the list based on the dataset or project name, in the filter field for the list, begin to type text from the name. Textual updates the list to only include matching datasets or projects.

  • To update all of the currently displayed datasets or projects, click Bulk action, then click Enable or Disable.

For information about enabling and disabling custom entity types from within a dataset, go to Working with custom entity types.

For information about enabling and disabling custom entity types from a guided redation project go to:

Last updated

Was this helpful?