diff --git a/src/current/utils/sourceMaterial.js b/src/current/utils/sourceMaterial.js index c6a338d4dc..438d7e9cc4 100644 --- a/src/current/utils/sourceMaterial.js +++ b/src/current/utils/sourceMaterial.js @@ -176,9 +176,10 @@ export const fetchData = async (language, issue) => { export const checkAYFExplainingBeliefsAssignment = (source) => { const { t } = getI18n(); + const boundary = '(?:^|\\s|$)'; const talk = t('talk', { lng: Setting.source_lang, ns: 'source' }); const demonstration = t('demonstration', { lng: Setting.source_lang, ns: 'source' }); - const searchKey = `\\b(${talk}|${demonstration})`; + const searchKey = boundary + `${talk}|${demonstration}` + boundary; const regex = new RegExp(searchKey, 'i'); const result = source.match(regex);