I would like to match all "options" that start with a hyphen like:

-one
-two

So all those would be a match from the "-" to the end of the word.

Looks like a simple

        /\<-\w\+\>/

It makes some presumptions where your description falls silent. What constitutes a "word" for you? The vim defintion of a word is embodied by the "\w" atom. However, it includes numbers and an underscore. If that's no good, you can change the "\w" to the set of desired characters with a character-class

        /\<-[a-zA-Z]\+\>/

Adjust accordingly.

-tim




Reply via email to