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

#Cisco #CCNA #Cisco2 #LongestMatch
§14.1.2 Best Path Equals Longest Match

Fijn uitlegfilmpje zonder de droge Netacad tekst | Nice explaining video without the dry #Netacad text

Thanks Jennifer Breeding!

https://www.youtube.com/watch?v=zKz8de2-nMA

270. Concepts of Using the Longest Match in the Routing Table

YouTube