Today I Learned

Giant Monkeys Learning

Ripgrep: searching with negative lookahead

Using ripgrep we can search using PCREs. First we need to enable pcre expressions in ~/.ripgreprc:

--pcre2

Then we can search for all occurences of mywordnot followed by _:

> rg 'myword(?!_)'