Skip to content

Commit

Permalink
rework the rules
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Jul 16, 2015
1 parent 51eab3f commit 2c82a01
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Octokit/Helpers/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,14 @@ static IEnumerable<string> 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)
{
Expand Down

0 comments on commit 2c82a01

Please sign in to comment.