{"action":"created","comment":{"url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/comments/26873780","id":26873780,"diff_hunk":"@@ -278,11 +280,30 @@ namespace UnitsNet\n         public static $className Parse(string str, IFormatProvider formatProvider = null)\n         {\n             if (str == null) throw new ArgumentNullException(\"str\");\n-            string[] words = str.Split(new[] {\" \"}, StringSplitOptions.RemoveEmptyEntries);\n-            if (words.Length < 2)\n+\n+            var numFormat = formatProvider != null ?\n+                (NumberFormatInfo) formatProvider.GetFormat(typeof (NumberFormatInfo)) :\n+                (NumberFormatInfo) CultureInfo.CurrentCulture.NumberFormat.Clone();\n+\n+            var numRegex = @\"[\\d., \"                        // allows digits, dots, commas, and spaces in the number by default\n+                         + numFormat.NumberGroupSeparator   // adds provided (or current) culture's group separator\n+                         + numFormat.NumberDecimalSeparator // adds provided (or current) culture's group separator\n+                         + @\"]*\\d\";                         // ensures quantity ends in digit\n+            var regexString = @\"\\s*\"                                                             // ignore leading whitespace\n+                            + @\"(?<value>[-+]?\" + numRegex + @\"(?:[eE][-+]?\" + numRegex + @\")?)\" // capture Quantity input","path":"Src/Scripts/Include-GenerateUnitClassSourceCode.ps1","position":29,"original_position":29,"commit_id":"8592d2e156fd10b10c74e449623bdcd04078359f","original_commit_id":"8592d2e156fd10b10c74e449623bdcd04078359f","user":{"login":"anjdreas","id":787816,"avatar_url":"https://avatars.githubusercontent.com/u/787816?v=3","gravatar_id":"","url":"https://api.github.com/users/anjdreas","html_url":"https://github.com/anjdreas","followers_url":"https://api.github.com/users/anjdreas/followers","following_url":"https://api.github.com/users/anjdreas/following{/other_user}","gists_url":"https://api.github.com/users/anjdreas/gists{/gist_id}","starred_url":"https://api.github.com/users/anjdreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjdreas/subscriptions","organizations_url":"https://api.github.com/users/anjdreas/orgs","repos_url":"https://api.github.com/users/anjdreas/repos","events_url":"https://api.github.com/users/anjdreas/events{/privacy}","received_events_url":"https://api.github.com/users/anjdreas/received_events","type":"User","site_admin":false},"body":"I think that second numRegex is overkill? To my knowledge scientific representation only has integers, so \\d+ or something should cover it.","created_at":"2015-03-20T20:33:04Z","updated_at":"2015-03-20T20:33:04Z","html_url":"https://github.com/InitialForce/UnitsNet/pull/64#discussion_r26873780","pull_request_url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64","_links":{"self":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/comments/26873780"},"html":{"href":"https://github.com/InitialForce/UnitsNet/pull/64#discussion_r26873780"},"pull_request":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64"}}},"pull_request":{"url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64","id":31645740,"html_url":"https://github.com/InitialForce/UnitsNet/pull/64","diff_url":"https://github.com/InitialForce/UnitsNet/pull/64.diff","patch_url":"https://github.com/InitialForce/UnitsNet/pull/64.patch","issue_url":"https://api.github.com/repos/InitialForce/UnitsNet/issues/64","number":64,"state":"open","locked":false,"title":"Regex parsing","user":{"login":"anjdreas","id":787816,"avatar_url":"https://avatars.githubusercontent.com/u/787816?v=3","gravatar_id":"","url":"https://api.github.com/users/anjdreas","html_url":"https://github.com/anjdreas","followers_url":"https://api.github.com/users/anjdreas/followers","following_url":"https://api.github.com/users/anjdreas/following{/other_user}","gists_url":"https://api.github.com/users/anjdreas/gists{/gist_id}","starred_url":"https://api.github.com/users/anjdreas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjdreas/subscriptions","organizations_url":"https://api.github.com/users/anjdreas/orgs","repos_url":"https://api.github.com/users/anjdreas/repos","events_url":"https://api.github.com/users/anjdreas/events{/privacy}","received_events_url":"https://api.github.com/users/anjdreas/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-20T19:45:32Z","updated_at":"2015-03-20T20:33:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0092224ed177228a917af3138099e03c05668ac7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64/commits","review_comments_url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64/comments","review_comment_url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/InitialForce/UnitsNet/issues/64/comments","statuses_url":"https://api.github.com/repos/InitialForce/UnitsNet/statuses/8592d2e156fd10b10c74e449623bdcd04078359f","head":{"label":"maherkassim:feature/regex-parsing","ref":"feature/regex-parsing","sha":"8592d2e156fd10b10c74e449623bdcd04078359f","user":{"login":"maherkassim","id":1304903,"avatar_url":"https://avatars.githubusercontent.com/u/1304903?v=3","gravatar_id":"","url":"https://api.github.com/users/maherkassim","html_url":"https://github.com/maherkassim","followers_url":"https://api.github.com/users/maherkassim/followers","following_url":"https://api.github.com/users/maherkassim/following{/other_user}","gists_url":"https://api.github.com/users/maherkassim/gists{/gist_id}","starred_url":"https://api.github.com/users/maherkassim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maherkassim/subscriptions","organizations_url":"https://api.github.com/users/maherkassim/orgs","repos_url":"https://api.github.com/users/maherkassim/repos","events_url":"https://api.github.com/users/maherkassim/events{/privacy}","received_events_url":"https://api.github.com/users/maherkassim/received_events","type":"User","site_admin":false},"repo":{"id":32518590,"name":"UnitsNet","full_name":"maherkassim/UnitsNet","owner":{"login":"maherkassim","id":1304903,"avatar_url":"https://avatars.githubusercontent.com/u/1304903?v=3","gravatar_id":"","url":"https://api.github.com/users/maherkassim","html_url":"https://github.com/maherkassim","followers_url":"https://api.github.com/users/maherkassim/followers","following_url":"https://api.github.com/users/maherkassim/following{/other_user}","gists_url":"https://api.github.com/users/maherkassim/gists{/gist_id}","starred_url":"https://api.github.com/users/maherkassim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maherkassim/subscriptions","organizations_url":"https://api.github.com/users/maherkassim/orgs","repos_url":"https://api.github.com/users/maherkassim/repos","events_url":"https://api.github.com/users/maherkassim/events{/privacy}","received_events_url":"https://api.github.com/users/maherkassim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maherkassim/UnitsNet","description":"Makes life working with units of measurement just a little bit better. Tags: units of measurement, measure, si, si units, metric, imperial, c#, .net, convert, conversion, parse, abbreviations, immutable data structures","fork":true,"url":"https://api.github.com/repos/maherkassim/UnitsNet","forks_url":"https://api.github.com/repos/maherkassim/UnitsNet/forks","keys_url":"https://api.github.com/repos/maherkassim/UnitsNet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maherkassim/UnitsNet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maherkassim/UnitsNet/teams","hooks_url":"https://api.github.com/repos/maherkassim/UnitsNet/hooks","issue_events_url":"https://api.github.com/repos/maherkassim/UnitsNet/issues/events{/number}","events_url":"https://api.github.com/repos/maherkassim/UnitsNet/events","assignees_url":"https://api.github.com/repos/maherkassim/UnitsNet/assignees{/user}","branches_url":"https://api.github.com/repos/maherkassim/UnitsNet/branches{/branch}","tags_url":"https://api.github.com/repos/maherkassim/UnitsNet/tags","blobs_url":"https://api.github.com/repos/maherkassim/UnitsNet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maherkassim/UnitsNet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maherkassim/UnitsNet/git/refs{/sha}","trees_url":"https://api.github.com/repos/maherkassim/UnitsNet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maherkassim/UnitsNet/statuses/{sha}","languages_url":"https://api.github.com/repos/maherkassim/UnitsNet/languages","stargazers_url":"https://api.github.com/repos/maherkassim/UnitsNet/stargazers","contributors_url":"https://api.github.com/repos/maherkassim/UnitsNet/contributors","subscribers_url":"https://api.github.com/repos/maherkassim/UnitsNet/subscribers","subscription_url":"https://api.github.com/repos/maherkassim/UnitsNet/subscription","commits_url":"https://api.github.com/repos/maherkassim/UnitsNet/commits{/sha}","git_commits_url":"https://api.github.com/repos/maherkassim/UnitsNet/git/commits{/sha}","comments_url":"https://api.github.com/repos/maherkassim/UnitsNet/comments{/number}","issue_comment_url":"https://api.github.com/repos/maherkassim/UnitsNet/issues/comments{/number}","contents_url":"https://api.github.com/repos/maherkassim/UnitsNet/contents/{+path}","compare_url":"https://api.github.com/repos/maherkassim/UnitsNet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maherkassim/UnitsNet/merges","archive_url":"https://api.github.com/repos/maherkassim/UnitsNet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maherkassim/UnitsNet/downloads","issues_url":"https://api.github.com/repos/maherkassim/UnitsNet/issues{/number}","pulls_url":"https://api.github.com/repos/maherkassim/UnitsNet/pulls{/number}","milestones_url":"https://api.github.com/repos/maherkassim/UnitsNet/milestones{/number}","notifications_url":"https://api.github.com/repos/maherkassim/UnitsNet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maherkassim/UnitsNet/labels{/name}","releases_url":"https://api.github.com/repos/maherkassim/UnitsNet/releases{/id}","created_at":"2015-03-19T11:57:31Z","updated_at":"2015-03-20T13:13:10Z","pushed_at":"2015-03-20T15:26:39Z","git_url":"git://github.com/maherkassim/UnitsNet.git","ssh_url":"git@github.com:maherkassim/UnitsNet.git","clone_url":"https://github.com/maherkassim/UnitsNet.git","svn_url":"https://github.com/maherkassim/UnitsNet","homepage":"https://www.nuget.org/packages/UnitsNet/","size":5349,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"InitialForce:develop","ref":"develop","sha":"7bc7ef2bc7339f2d6150d889a64f3ecf43795bca","user":{"login":"InitialForce","id":4833161,"avatar_url":"https://avatars.githubusercontent.com/u/4833161?v=3","gravatar_id":"","url":"https://api.github.com/users/InitialForce","html_url":"https://github.com/InitialForce","followers_url":"https://api.github.com/users/InitialForce/followers","following_url":"https://api.github.com/users/InitialForce/following{/other_user}","gists_url":"https://api.github.com/users/InitialForce/gists{/gist_id}","starred_url":"https://api.github.com/users/InitialForce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InitialForce/subscriptions","organizations_url":"https://api.github.com/users/InitialForce/orgs","repos_url":"https://api.github.com/users/InitialForce/repos","events_url":"https://api.github.com/users/InitialForce/events{/privacy}","received_events_url":"https://api.github.com/users/InitialForce/received_events","type":"Organization","site_admin":false},"repo":{"id":11521218,"name":"UnitsNet","full_name":"InitialForce/UnitsNet","owner":{"login":"InitialForce","id":4833161,"avatar_url":"https://avatars.githubusercontent.com/u/4833161?v=3","gravatar_id":"","url":"https://api.github.com/users/InitialForce","html_url":"https://github.com/InitialForce","followers_url":"https://api.github.com/users/InitialForce/followers","following_url":"https://api.github.com/users/InitialForce/following{/other_user}","gists_url":"https://api.github.com/users/InitialForce/gists{/gist_id}","starred_url":"https://api.github.com/users/InitialForce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InitialForce/subscriptions","organizations_url":"https://api.github.com/users/InitialForce/orgs","repos_url":"https://api.github.com/users/InitialForce/repos","events_url":"https://api.github.com/users/InitialForce/events{/privacy}","received_events_url":"https://api.github.com/users/InitialForce/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InitialForce/UnitsNet","description":"Makes life working with units of measurement just a little bit better. Tags: units of measurement, measure, si, si units, metric, imperial, c#, .net, convert, conversion, parse, abbreviations, immutable data structures","fork":false,"url":"https://api.github.com/repos/InitialForce/UnitsNet","forks_url":"https://api.github.com/repos/InitialForce/UnitsNet/forks","keys_url":"https://api.github.com/repos/InitialForce/UnitsNet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InitialForce/UnitsNet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InitialForce/UnitsNet/teams","hooks_url":"https://api.github.com/repos/InitialForce/UnitsNet/hooks","issue_events_url":"https://api.github.com/repos/InitialForce/UnitsNet/issues/events{/number}","events_url":"https://api.github.com/repos/InitialForce/UnitsNet/events","assignees_url":"https://api.github.com/repos/InitialForce/UnitsNet/assignees{/user}","branches_url":"https://api.github.com/repos/InitialForce/UnitsNet/branches{/branch}","tags_url":"https://api.github.com/repos/InitialForce/UnitsNet/tags","blobs_url":"https://api.github.com/repos/InitialForce/UnitsNet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InitialForce/UnitsNet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InitialForce/UnitsNet/git/refs{/sha}","trees_url":"https://api.github.com/repos/InitialForce/UnitsNet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InitialForce/UnitsNet/statuses/{sha}","languages_url":"https://api.github.com/repos/InitialForce/UnitsNet/languages","stargazers_url":"https://api.github.com/repos/InitialForce/UnitsNet/stargazers","contributors_url":"https://api.github.com/repos/InitialForce/UnitsNet/contributors","subscribers_url":"https://api.github.com/repos/InitialForce/UnitsNet/subscribers","subscription_url":"https://api.github.com/repos/InitialForce/UnitsNet/subscription","commits_url":"https://api.github.com/repos/InitialForce/UnitsNet/commits{/sha}","git_commits_url":"https://api.github.com/repos/InitialForce/UnitsNet/git/commits{/sha}","comments_url":"https://api.github.com/repos/InitialForce/UnitsNet/comments{/number}","issue_comment_url":"https://api.github.com/repos/InitialForce/UnitsNet/issues/comments{/number}","contents_url":"https://api.github.com/repos/InitialForce/UnitsNet/contents/{+path}","compare_url":"https://api.github.com/repos/InitialForce/UnitsNet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InitialForce/UnitsNet/merges","archive_url":"https://api.github.com/repos/InitialForce/UnitsNet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InitialForce/UnitsNet/downloads","issues_url":"https://api.github.com/repos/InitialForce/UnitsNet/issues{/number}","pulls_url":"https://api.github.com/repos/InitialForce/UnitsNet/pulls{/number}","milestones_url":"https://api.github.com/repos/InitialForce/UnitsNet/milestones{/number}","notifications_url":"https://api.github.com/repos/InitialForce/UnitsNet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InitialForce/UnitsNet/labels{/name}","releases_url":"https://api.github.com/repos/InitialForce/UnitsNet/releases{/id}","created_at":"2013-07-19T06:00:54Z","updated_at":"2015-03-19T21:32:12Z","pushed_at":"2015-03-20T19:45:33Z","git_url":"git://github.com/InitialForce/UnitsNet.git","ssh_url":"git@github.com:InitialForce/UnitsNet.git","clone_url":"https://github.com/InitialForce/UnitsNet.git","svn_url":"https://github.com/InitialForce/UnitsNet","homepage":"https://www.nuget.org/packages/UnitsNet/","size":5349,"stargazers_count":47,"watchers_count":47,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":2,"forks":23,"open_issues":2,"watchers":47,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64"},"html":{"href":"https://github.com/InitialForce/UnitsNet/pull/64"},"issue":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/issues/64"},"comments":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/issues/64/comments"},"review_comments":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64/comments"},"review_comment":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/pulls/64/commits"},"statuses":{"href":"https://api.github.com/repos/InitialForce/UnitsNet/statuses/8592d2e156fd10b10c74e449623bdcd04078359f"}}}}