I\'m trying to match SHA1\'s in generic text with a regular expression.
Ideally I want to avoid matching words.
It\'s safe to say that full SHA1\'s have a d
I use this in ruby. It allows for a short version of the sha (6 - 8 in case of clashes) and for the full sha at 40 chars long.
\A(([0-9a-f]{40})|([0-9a-f]{6,8}))\z