Managing regex-based custom entity types
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
To create a regex-based custom entity type, on the Custom Entity Types page:
Click Create Custom Entity Type.
In the dropdown, click Regex-based entity type.

After you configure the 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
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:
In the custom entity types list, click the delete icon for the entity type.
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.

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:
From the dropdown list, select the entry to test.

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.

Enabling and disabling the regex-based entity type for datasets
Under Activate custom entity, you identify the datasets to make the entity active for. From the dataset details, you can also enable and disable custom entity types for that dataset.

To make the entity active for all current and future datasets, check Automatically activate for all current and new datasets.
To make the entity active for specific datasets, set the toggle for the dataset to the on position.
To filter the list based on the dataset name, in the filter field, begin to type text from the name. Textual updates the list to only include matching datasets.
To update all of the currently displayed datasets, click Bulk action, then click Enable or Disable.
You can also enable and disable custom entity types from within a dataset. For more information, go to Working with custom entity types.
Last updated
Was this helpful?
