Closed InnoraG closed 3 years ago
Very small change in core testTrigger but critical for precise bot dialog :
Problem : const test = new RegExp(trigger.pattern as string, 'i'); is always broad and do not let exact matching control
const test = new RegExp(trigger.pattern as string, 'i');
Solution : const test = new RegExp('^' + trigger.pattern + '$', 'i'); is the correction
const test = new RegExp('^' + trigger.pattern + '$', 'i');
Application : As example that change correct Exact String Match functionality of Botkit CMS which is wrongly broad
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Very small change in core testTrigger but critical for precise bot dialog :
Problem :
const test = new RegExp(trigger.pattern as string, 'i');
is always broad and do not let exact matching controlSolution :
const test = new RegExp('^' + trigger.pattern + '$', 'i');
is the correctionApplication : As example that change correct Exact String Match functionality of Botkit CMS which is wrongly broad