rework the rules

This commit is contained in:
Brendan Forster
2015-07-17 07:53:18 +09:30
parent 8596019e14
commit e4ec54d09a
2 changed files with 29 additions and 11 deletions
+6 -3
View File
@@ -102,11 +102,14 @@ namespace Octokit
yield return new String(letters, wordStartIndex, letters.Length - wordStartIndex);
}
static Regex nameWithOwner = new Regex("[a-zA-Z.]{1,}/[a-zA-Z.]{1,}"
// the rule:
// Username may only contain alphanumeric characters or single hyphens
// and cannot begin or end with a hyphen
static readonly Regex nameWithOwner = new Regex("[a-z0-9.-]{1,}/[a-z0-9.-]{1,}",
#if (!PORTABLE && !NETFX_CORE)
, RegexOptions.Compiled
RegexOptions.Compiled |
#endif
);
RegexOptions.IgnoreCase);
internal static bool IsNameWithOwnerFormat(this string input)
{