From a0f2d7490f0678ed591de7300e4a7b64e8284a18 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 24 Apr 2024 01:43:05 +0100 Subject: [PATCH] Fix to likely intended regex --- src/view/com/composer/text-input/text-input-util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/com/composer/text-input/text-input-util.ts b/src/view/com/composer/text-input/text-input-util.ts index 7b05f1a47d..8ab0832090 100644 --- a/src/view/com/composer/text-input/text-input-util.ts +++ b/src/view/com/composer/text-input/text-input-util.ts @@ -60,7 +60,7 @@ export function findIndexInText(term: string, text: string) { // HELLO SENTENCE http://google.com HELLO // http://google.com/ HELLO. // http://google.com/. - const pattern = new RegExp(`\\b(${escapeRegex(term)})(?!w)`, 'i') + const pattern = new RegExp(`\\b(${escapeRegex(term)})(?![/\\w])`, 'i') const match = pattern.exec(text) return match ? match.index : -1 }