我正在尝试仅将 GitHub URL 与以下输入标签匹配:
<input type="url" id="repoUrl" title="Must be a full URL to a GitHub repository" pattern="^https:\/\/github\.com\/" required>
在 regex101 中,这个确切的模式匹配所有以“ https://github.com ”开头的字符串,这是我想要的,但问题是当我checkValidity()
在该输入上调用该方法时,它只说如果输入是有效的只有“ https://github.com ”。
我需要改变什么才能使这个正则表达式在 regex101 中工作?