The problem is that /-o will also match something like --my-irrelevant-option.
Word boundaries match the end (or the beginning) of the word.
How exactly to do it depends on the regex library, my less is built with PCRE2 therefore I can do /-o\b.









This is not difficult to achieve at all with tools like
sedorawk. But unless you provide a concrete example input file or files, all we can do is point to those tools.