Fix to likely intended regex
This commit is contained in:
@@ -60,7 +60,7 @@ export function findIndexInText(term: string, text: string) {
|
|||||||
// HELLO SENTENCE http://google.com HELLO
|
// HELLO SENTENCE http://google.com HELLO
|
||||||
// http://google.com/ HELLO.
|
// http://google.com/ HELLO.
|
||||||
// http://google.com/.
|
// 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)
|
const match = pattern.exec(text)
|
||||||
return match ? match.index : -1
|
return match ? match.index : -1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user