nothingislost / obsidian-dynamic-highlights

An experimental Obsidian plugin that highlights all occurrences of the word under the cursor
MIT License
132 stars 7 forks source link

Only first match on a line is highlighted #29

Open phlind opened 2 years ago

phlind commented 2 years ago

I have the issue that a match is only highlighted the first time per line:

Bildschirmfoto 2022-01-24 um 21 56 24

Here are the settings:

Bildschirmfoto 2022-01-24 um 21 58 24

nothingislost commented 2 years ago

Your regex is too greedy and is eating the entire line. You probably want something more like \[((.*?) )?@(.*?)(, (.*?))?\]