Fun with git pickaxe. Try

git log --pickaxe-regex -S 'a.*zz'

and see that it takes ages.

Most regex engines let a dot not match an end of line. But pickaxe explicitly requests it. Therefore 'a.*zz' matches from every 'a' through to the last character of a diff in search for a pair of 'z'. If it does not find it, it moves to the next 'a' and starts over. Principle of the longest match.

Try with 'e.*zz' an explain why it takes even longer.😎

#git #regex #longestMatch #gitLogPickaxe