C++ regex for overlapping matches

Your regex can be put into the capturing parentheses that can be wrapped with a positive lookahead. To make it work on Mac, too, make sure the regex matches (and thus consumes) a single char at each match by placing a . (or – to also match line break chars – [\s\S]) after the lookahead. … Read more