I want to search inside multiple big text files (200MB each) as fast as possible. I am using the command line tool ripgrep and I want to call it only once.
In the following string:
***foo***bar***baz***foo***bar***baz
(***
stands for a different type and number of characters.)
I want to match baz
, but only if it follows the first occurence of foo***bar***
So in ***foo***bar***baz***foo***bar***baz
it matches the first baz
and in ***foo***bar***qux***foo***bar***baz
it shall match nothing.
I tried several solutions but it did not work. Can this be done with a single regular expression?