get_sha1: support $commit^{/regex} syntax