What will be proper regular expression for git repositories?
example link:
git@github.com:someone/someproject.git
so it will be like
[user]@[server]:[project].git
server can be url or ip
Project can contain some other characters than alphanumeric like ‘-‘
I’m not sure what is the role of ‘/’
any suggestions?
Git accepts a large range of repository URL expressions:
For an application that I wrote that requires parsing of these expressions (YonderGit), I came up with the following (Python) regular expressions:
For most repository URL’s encountered “in the wild”, I suspect (1) suffices.