Use regex extract action in validation rule
- Updated: 2024/03/21
Use regex extract action in validation rule
The regex extract action allows users to apply a custom regular expression (regex) to the values extracted from documents. With this action, users can manipulate the extracted data by extracting specific sub-strings based on the specified regex pattern.
When a document is processed and a value is extracted, you can apply the
regex extract action to this value. You can define a
regex pattern which will be used to identify and extract a specific part of the
extracted value.
Note: It extracts only the first match found
in the value based on the specified regex pattern.
Prerequisites
- When you apply the regex extract action, the system sets a field value with the first regex match during extraction.
- If the specified regex does not have a match for the field, it returns an empty field value.
- If you do not have an updated (v.31) package connected to a learning instance, you will encounter a warning message to indicate that this rule might not work as expected.
Example
This feature is particularly useful in scenarios where only a portion of the extracted data is needed. For example, extracting a specific set of numbers from a larger string, isolating a part of an address, or retrieving a specific fragment from a table description.
In the below example, if you want to extract the Vendor Code from the Description column of the document, it retrieves all the description text from the Description column.The following image shows Vendor Code values with regular extraction process.
In this example, we will see how to extract only Vendor Code from the Description column of document.