I have been going through some answers to a vimgolf, and stumbled upon this regex::s/\_W*/-/g|x<CR>Which converts abcdefghijklmto-a-b-c-d-e-f-g-h-i-j-k-l-m-The regex (without unrelated keystrokes) is /\_W*/-/. The manual indicates that: \W stands for non-word character:       [^0-9A-Za-z_]\_x   Where x is any of the characters above: The character class with    end-of-line addedSo \_W is non-word characters with end-of-line added.How does that put the dashes between the characters? Is there a hidden metacharacter between each character in vim text?
Understanding \_W* in vim regex
regular expression
This is not a question of hidden character, the trick comes from the * combined with the flag g:Specifying * after a character classe will match zero or more items (which includes an empty string): between a and b there is zero non-word character, thus \W* will match this not existing space.For example you could also have used \_s* or \_d* and still get the same result since you match zero items of the class.