How to omit first character in autocompletion option label?

I want to start autocompletion after user type a @ character, which will open a tooltip box with a username list.
I have to define a regex like /(^@[\w]*$)|((?<=\s)@[\w]*$)/ (@ must in the beginning or there is a whitespace before @)
But the regex is also used in completion source options filter, so the option label text also need start with @.
I hope the label text is a pure username without redundant @.

Currently, I return a completion source with from: word.from + 1 to match the remaining token after @.
It works, but the workaround got another problem. Backspace to the beginning @ will not open tooltip.

@ => tooltip with init options
@x => tooltip with filtered options
Then I press Backspace to delete chars until @
@ => none tooltip opened.

  function completionSource(context) {
    let word = context.matchBefore(regex);
    if (word == null) {
      return null;

    return {
      from: word.from + 1,
      // validFor: regexValidFor,

Due to the need to underline matching characters, there’s no way to have the visible label and the matched text be different.

@marijn Since I use word.from + 1 to ignore the first character to be matched. When Backspace to the first character, the code in the image below is the cause of the problem, pos == from.

So if I modify a diff below, it will work as my expect. But I’m not sure if my solution is right.

- this.explicitPos < 0 ? pos <= from : pos < this.from) ||
+ pos < this.from ||