diff --git a/web/app/components/base/prompt-editor/hooks.ts b/web/app/components/base/prompt-editor/hooks.ts index 4e9e95529f..79fe07f0c2 100644 --- a/web/app/components/base/prompt-editor/hooks.ts +++ b/web/app/components/base/prompt-editor/hooks.ts @@ -158,9 +158,9 @@ export function useBasicTypeaheadTriggerMatch( ): TriggerFn { return useCallback( (text: string) => { - const validChars = `[^${trigger}${PUNCTUATION}\\s]` + const validChars = `[${PUNCTUATION}\\s]` const TypeaheadTriggerRegex = new RegExp( - `([^${trigger}]|^)(` + '(.*)(' + `[${trigger}]` + `((?:${validChars}){0,${maxLength}})` + ')$',