Skip to main content

Pattern Entities

Pattern or Regular Expression Extraction allows you to extract information presented in a format that can be described using Regular Expression (RegEx). Once you've created a pattern entity, Botpress Native NLU will perform a regex extraction on each incoming message and add it to event.nlu.entities.


Given a Pattern Entity definition with [A-Z]{3}-[0-9]{4}-[A-Z]{3} as pattern:

Extraction will go like this:

User saidTypeValue
Find product BHZ-1234-UYTSKUBHZ-1234-UYT
{ name: 'SKU',
type: 'pattern',
{ confidence: 1,
provider: 'native',
source: 'BHZ-1234-UYT',
start: 13,
end: 25,
raw: {} },
data: {
extras: {},
value: 'BHZ-1234-UYT',
unit: 'string'