In addition to -
and _
, which other special characters can be contained in a github repository name?
I need to do some regex on github urls, and need to know the rules for repository root urls, which are of the form
https://github.com/username/repo
where
username
is the username of the owner of the repository, and,repo
is the repository nameSo far, my regex works well, but doesn't cater to repositories with special characters, so I must include them. Written in R, the regex is github.com/*/[[:alpha:]]
.
Note: Here are listed the rules for github usernames - I am after the same thing but for repository names
As mentioned in moby/moby
issue 679:
it looks like github allows [A-Za-z0-9_.-], and transforms all other characters to "-".
So: in addition to letters, numbers, -
and _
the only other allowable character is '.
'
This is illustrated in GitHub Desktop application, with desktop/desktop issue 3090: "Block emoji from being entered as a repo name"(!)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With