Regex assumes that .git extensions will always exist, but doing a git clone will leave it out.

Make regex .git check to be optional.