diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 8a1ff18e7..d21e32d7e 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -192,7 +192,8 @@ class WorldInfoBuffer { return haystack.includes(transformedString); } else { - const regex = new RegExp(`\\b${escapeRegex(transformedString)}\\b`); + // Use custom boundaries to include punctuation and other non-alphanumeric characters + const regex = new RegExp(`(?:^|\\W)(${escapeRegex(transformedString)})(?:$|\\W)`); if (regex.test(haystack)) { return true; }