From 2c82a01018ed244a84539b317f0e22534c902e45 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Fri, 17 Jul 2015 07:53:18 +0930 Subject: [PATCH] rework the rules --- Octokit/Helpers/StringExtensions.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Octokit/Helpers/StringExtensions.cs b/Octokit/Helpers/StringExtensions.cs index 33008b3e15..670eddf244 100644 --- a/Octokit/Helpers/StringExtensions.cs +++ b/Octokit/Helpers/StringExtensions.cs @@ -102,11 +102,14 @@ static IEnumerable SplitUpperCase(this string source) 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) {