Vim's search patterns for the words taking into account camelCase and snake_case.
Also, you can modify it for kebab-case (but I don't use it anywhere), e.g. replace every _
to \(_\|-\)
VSCode's "WordPart" works a little differently for snake_case (worse imo). These patterns work greedy for underscores.
Don't forget to escape characters if you gonna use it in lua. There are some possible patterns for you: