mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-03 18:15:01 +00:00
refactor: simplfy the regex to check remote's URL with HTTP/HTTPS/GIT protocol
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
598ba6d9f6
commit
5e05c008fc
1 changed files with 2 additions and 2 deletions
|
@ -6,9 +6,9 @@ namespace SourceGit.Models
|
|||
{
|
||||
public partial class Remote
|
||||
{
|
||||
[GeneratedRegex(@"^https?://([-a-zA-Z0-9:%._\+~#=]+@)?[-a-zA-Z0-9:%._\+~#=]{1,256}(\.[a-zA-Z0-9()]{1,6})?(:[0-9]{1,5})?\b(/[-a-zA-Z0-9()@:%_\+.~#?&=]+)+(\.git)?$")]
|
||||
[GeneratedRegex(@"^https?://[^/]+/.+[^/\.]$")]
|
||||
private static partial Regex REG_HTTPS();
|
||||
[GeneratedRegex(@"^git://([-a-zA-Z0-9:%._\+~#=]+@)?[-a-zA-Z0-9:%._\+~#=]{1,256}(\.[a-zA-Z0-9()]{1,6})?(:[0-9]{1,5})?\b(/[-a-zA-Z0-9()@:%_\+.~#?&=]+)+(\.git)?$")]
|
||||
[GeneratedRegex(@"^git://[^/]+/.+[^/\.]$")]
|
||||
private static partial Regex REG_GIT();
|
||||
[GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:([a-zA-z0-9~%][\w\-\./~%]*)?[a-zA-Z0-9](\.git)?$")]
|
||||
private static partial Regex REG_SSH1();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue