improve(code-completion): improve regex matching performance