{"action":"created","comment":{"url":"https://api.github.com/repos/NuGet/NuGet2/pulls/comments/76639330","id":76639330,"diff_hunk":"@@ -16,8 +17,13 @@ namespace NuGet\n     public sealed class SemanticVersion : IComparable, IComparable<SemanticVersion>, IEquatable<SemanticVersion>\r\n     {\r\n         private const RegexOptions _flags = RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture;\r\n-        private static readonly Regex _semanticVersionRegex = new Regex(@\"^(?<Version>\\d+(\\s*\\.\\s*\\d+){0,3})(?<Release>-[a-z][0-9a-z-]*)?$\", _flags);\r\n-        private static readonly Regex _strictSemanticVersionRegex = new Regex(@\"^(?<Version>\\d+(\\.\\d+){2})(?<Release>-[a-z][0-9a-z-]*)?$\", _flags);\r\n+\r\n+        // Versions containing up to 4 digits\r\n+        private static readonly Regex _semanticVersionRegex = new Regex(@\"^(?<Version>\\d+(\\s*\\.\\s*\\d+){0,3})(?<Release>-([0]\\b|[0]$|[0][0-9]*[A-Za-z-]+|[1-9A-Za-z-][0-9A-Za-z-]*)+(\\.([0]\\b|[0]$|[0][0-9]*[A-Za-z-]+|[1-9A-Za-z-][0-9A-Za-z-]*)+)*)?(?<Metadata>\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$\", _flags);\r","path":"src/Core/SemanticVersion.cs","position":14,"original_position":14,"commit_id":"dc6c6d5ebc4aec54ae7504c7ff04c964c76795b4","original_commit_id":"dc6c6d5ebc4aec54ae7504c7ff04c964c76795b4","user":{"login":"joelverhagen","id":94054,"avatar_url":"https://avatars.githubusercontent.com/u/94054?v=3","gravatar_id":"","url":"https://api.github.com/users/joelverhagen","html_url":"https://github.com/joelverhagen","followers_url":"https://api.github.com/users/joelverhagen/followers","following_url":"https://api.github.com/users/joelverhagen/following{/other_user}","gists_url":"https://api.github.com/users/joelverhagen/gists{/gist_id}","starred_url":"https://api.github.com/users/joelverhagen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelverhagen/subscriptions","organizations_url":"https://api.github.com/users/joelverhagen/orgs","repos_url":"https://api.github.com/users/joelverhagen/repos","events_url":"https://api.github.com/users/joelverhagen/events{/privacy}","received_events_url":"https://api.github.com/users/joelverhagen/received_events","type":"User","site_admin":false},"body":"This regex is a monster. Would it be possible to move it to a string const, break it up into multiple lines, and comment? There are definitely some repeated substrings. Could those maybe me moved to little descriptive constants?\r\n\r\nI can follow almost all of the regex, but what does `[0]\\b` do? That looks like a one character character class, which is odd.","created_at":"2016-08-29T16:33:47Z","updated_at":"2016-08-29T16:33:47Z","html_url":"https://github.com/NuGet/NuGet2/pull/59#discussion_r76639330","pull_request_url":"https://api.github.com/repos/NuGet/NuGet2/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/comments/76639330"},"html":{"href":"https://github.com/NuGet/NuGet2/pull/59#discussion_r76639330"},"pull_request":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/NuGet/NuGet2/pulls/59","id":83034449,"html_url":"https://github.com/NuGet/NuGet2/pull/59","diff_url":"https://github.com/NuGet/NuGet2/pull/59.diff","patch_url":"https://github.com/NuGet/NuGet2/pull/59.patch","issue_url":"https://api.github.com/repos/NuGet/NuGet2/issues/59","number":59,"state":"open","locked":false,"title":"Adding SemVer 2.0.0 support","user":{"login":"emgarten","id":6381138,"avatar_url":"https://avatars.githubusercontent.com/u/6381138?v=3","gravatar_id":"","url":"https://api.github.com/users/emgarten","html_url":"https://github.com/emgarten","followers_url":"https://api.github.com/users/emgarten/followers","following_url":"https://api.github.com/users/emgarten/following{/other_user}","gists_url":"https://api.github.com/users/emgarten/gists{/gist_id}","starred_url":"https://api.github.com/users/emgarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emgarten/subscriptions","organizations_url":"https://api.github.com/users/emgarten/orgs","repos_url":"https://api.github.com/users/emgarten/repos","events_url":"https://api.github.com/users/emgarten/events{/privacy}","received_events_url":"https://api.github.com/users/emgarten/received_events","type":"User","site_admin":false},"body":"This updates NuGet.SemanticVersion to support SemVer 2.0.0.\r\n\r\nPrimary change here is:\r\n* Update the regex used to parse versions. These were previously used in NuGet.Versioning.\r\n* Copied release label compare from NuGet.Versioning\r\n\r\nUnit tests have been ported over from NuGet 3.x for version parsing and ranges.\r\n\r\nMetadata will be carried along with the version but is only displayed when using one of the new methods, ToOriginalString, or ToFullString. This is the same behavior that NuGet.Versioning uses.\r\n\r\nThis change allows NuGet.Server and other projects still relying on NuGet.Core to handle SemVer 2.0.0.\r\n\r\nFixes https://github.com/NuGet/Home/issues/3383\r\n\r\n//cc @xavierdecoster @joelverhagen @maartenba @rohit21agrawal @rrelyea @yishaigalatzer ","created_at":"2016-08-29T01:30:40Z","updated_at":"2016-08-29T16:33:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b5272e8b93f37e42bbc3e5ee17bd90956c7c747","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/NuGet/NuGet2/pulls/59/commits","review_comments_url":"https://api.github.com/repos/NuGet/NuGet2/pulls/59/comments","review_comment_url":"https://api.github.com/repos/NuGet/NuGet2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NuGet/NuGet2/issues/59/comments","statuses_url":"https://api.github.com/repos/NuGet/NuGet2/statuses/dc6c6d5ebc4aec54ae7504c7ff04c964c76795b4","head":{"label":"NuGet:dev-emgarten-semver2","ref":"dev-emgarten-semver2","sha":"dc6c6d5ebc4aec54ae7504c7ff04c964c76795b4","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":35458771,"name":"NuGet2","full_name":"NuGet/NuGet2","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet2","description":"This is the home of nuget.core and all the repos from codeplex.","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet2","forks_url":"https://api.github.com/repos/NuGet/NuGet2/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet2/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet2/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet2/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet2/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet2/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet2/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet2/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet2/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet2/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet2/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet2/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet2/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet2/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet2/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet2/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet2/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet2/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet2/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet2/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet2/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet2/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet2/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet2/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet2/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet2/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet2/releases{/id}","deployments_url":"https://api.github.com/repos/NuGet/NuGet2/deployments","created_at":"2015-05-12T01:06:45Z","updated_at":"2016-08-04T06:24:54Z","pushed_at":"2016-08-29T01:30:40Z","git_url":"git://github.com/NuGet/NuGet2.git","ssh_url":"git@github.com:NuGet/NuGet2.git","clone_url":"https://github.com/NuGet/NuGet2.git","svn_url":"https://github.com/NuGet/NuGet2","homepage":null,"size":54223,"stargazers_count":51,"watchers_count":51,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":16,"forks":48,"open_issues":16,"watchers":51,"default_branch":"2.13"}},"base":{"label":"NuGet:2.13","ref":"2.13","sha":"e89c4b2fc6dc2fc752d2fceecd2a2175b0f4ab69","user":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"repo":{"id":35458771,"name":"NuGet2","full_name":"NuGet/NuGet2","owner":{"login":"NuGet","id":968310,"avatar_url":"https://avatars.githubusercontent.com/u/968310?v=3","gravatar_id":"","url":"https://api.github.com/users/NuGet","html_url":"https://github.com/NuGet","followers_url":"https://api.github.com/users/NuGet/followers","following_url":"https://api.github.com/users/NuGet/following{/other_user}","gists_url":"https://api.github.com/users/NuGet/gists{/gist_id}","starred_url":"https://api.github.com/users/NuGet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NuGet/subscriptions","organizations_url":"https://api.github.com/users/NuGet/orgs","repos_url":"https://api.github.com/users/NuGet/repos","events_url":"https://api.github.com/users/NuGet/events{/privacy}","received_events_url":"https://api.github.com/users/NuGet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NuGet/NuGet2","description":"This is the home of nuget.core and all the repos from codeplex.","fork":false,"url":"https://api.github.com/repos/NuGet/NuGet2","forks_url":"https://api.github.com/repos/NuGet/NuGet2/forks","keys_url":"https://api.github.com/repos/NuGet/NuGet2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NuGet/NuGet2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NuGet/NuGet2/teams","hooks_url":"https://api.github.com/repos/NuGet/NuGet2/hooks","issue_events_url":"https://api.github.com/repos/NuGet/NuGet2/issues/events{/number}","events_url":"https://api.github.com/repos/NuGet/NuGet2/events","assignees_url":"https://api.github.com/repos/NuGet/NuGet2/assignees{/user}","branches_url":"https://api.github.com/repos/NuGet/NuGet2/branches{/branch}","tags_url":"https://api.github.com/repos/NuGet/NuGet2/tags","blobs_url":"https://api.github.com/repos/NuGet/NuGet2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NuGet/NuGet2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NuGet/NuGet2/git/refs{/sha}","trees_url":"https://api.github.com/repos/NuGet/NuGet2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NuGet/NuGet2/statuses/{sha}","languages_url":"https://api.github.com/repos/NuGet/NuGet2/languages","stargazers_url":"https://api.github.com/repos/NuGet/NuGet2/stargazers","contributors_url":"https://api.github.com/repos/NuGet/NuGet2/contributors","subscribers_url":"https://api.github.com/repos/NuGet/NuGet2/subscribers","subscription_url":"https://api.github.com/repos/NuGet/NuGet2/subscription","commits_url":"https://api.github.com/repos/NuGet/NuGet2/commits{/sha}","git_commits_url":"https://api.github.com/repos/NuGet/NuGet2/git/commits{/sha}","comments_url":"https://api.github.com/repos/NuGet/NuGet2/comments{/number}","issue_comment_url":"https://api.github.com/repos/NuGet/NuGet2/issues/comments{/number}","contents_url":"https://api.github.com/repos/NuGet/NuGet2/contents/{+path}","compare_url":"https://api.github.com/repos/NuGet/NuGet2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NuGet/NuGet2/merges","archive_url":"https://api.github.com/repos/NuGet/NuGet2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NuGet/NuGet2/downloads","issues_url":"https://api.github.com/repos/NuGet/NuGet2/issues{/number}","pulls_url":"https://api.github.com/repos/NuGet/NuGet2/pulls{/number}","milestones_url":"https://api.github.com/repos/NuGet/NuGet2/milestones{/number}","notifications_url":"https://api.github.com/repos/NuGet/NuGet2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NuGet/NuGet2/labels{/name}","releases_url":"https://api.github.com/repos/NuGet/NuGet2/releases{/id}","deployments_url":"https://api.github.com/repos/NuGet/NuGet2/deployments","created_at":"2015-05-12T01:06:45Z","updated_at":"2016-08-04T06:24:54Z","pushed_at":"2016-08-29T01:30:40Z","git_url":"git://github.com/NuGet/NuGet2.git","ssh_url":"git@github.com:NuGet/NuGet2.git","clone_url":"https://github.com/NuGet/NuGet2.git","svn_url":"https://github.com/NuGet/NuGet2","homepage":null,"size":54223,"stargazers_count":51,"watchers_count":51,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":16,"forks":48,"open_issues":16,"watchers":51,"default_branch":"2.13"}},"_links":{"self":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/59"},"html":{"href":"https://github.com/NuGet/NuGet2/pull/59"},"issue":{"href":"https://api.github.com/repos/NuGet/NuGet2/issues/59"},"comments":{"href":"https://api.github.com/repos/NuGet/NuGet2/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NuGet/NuGet2/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/NuGet/NuGet2/statuses/dc6c6d5ebc4aec54ae7504c7ff04c964c76795b4"}}}}
{"actor":{"display_login":"joelverhagen"}}