This matches a word /\w\+
This matches a any number of dots /\.\+
Why doesn't this match any number of words combined by dots? /[\w\.]\+ ?
The w seems to be matching actual 'w's instead of a word character, whether I escape it or not.
This matches a word /\w\+
This matches a any number of dots /\.\+
Why doesn't this match any number of words combined by dots? /[\w\.]\+ ?
The w seems to be matching actual 'w's instead of a word character, whether I escape it or not.
Copyright © 2021 Jogjafile Inc.
See "PREDEFINED RANGES" in Vim documentation: usr_27:
So, your work-around would be
/[a-zA-Z\.]\+if you want to exclude digits and underscore that are matched with\w, or/[a-zA-Z0-9_\.]\+to emulate the\wfunctionality. If POSIX bracketed classes are supported,/[[:alpha:]\.]\+(or for full emulation,/[[:alpha:][:digit:]_\.]\+) is also an option.There are also other ways, see this SO post where 2 other alternatives are suggested:
\%(\w\|\.\)\+\%[\w\.]\+