除了-
和 _
,还有哪些其他特殊字符可以包含在 github 存储库名称中?
背景
我需要在 github url 上做一些正则表达式,并且需要知道存储库根 url 的规则,其形式为
https://github.com/username/repo
在哪里username
是存储库所有者的用户名,repo
是存储库名称 到目前为止,我的正则表达式运行良好,但不适合具有特殊字符的存储库,因此我必须包含它们。用 R 编写,正则表达式是
github.com/*/[[:alpha:]]
.注意:这里列出了rules for github usernames - 我追求同样的事情,但对于存储库名称
最佳答案
如 moby/moby
issue 679 中所述:
it looks like github allows [A-Za-z0-9_.-], and transforms all other characters to "-".
所以:除了字母,数字,
-
和 _
唯一允许的其他字符是 ' .
'这在 GitHub 桌面应用程序中进行了说明,desktop/desktop issue 3090 :“阻止表情符号作为 repo 名称输入”(!)
关于github - github存储库名称中特殊字符的规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59081778/