{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/33155718","id":33155718,"diff_hunk":"@@ -15,6 +15,8 @@ type Regex\n     extra::Ptr{Void}\n     ovec::Vector{Csize_t}\n     match_data::Ptr{Void}\n+    capture_name_to_idx::Dict{Symbol, Int}\n+    idx_to_capture_name::Dict{Int, Symbol}","path":"base/regex.jl","position":null,"original_position":5,"commit_id":"1b0127cd7af78b5e9a769a667bb17739c19641fd","original_commit_id":"0479e7a9a8ba612ce8c141e0a777b6eece09e3ed","user":{"login":"malmaud","id":987837,"avatar_url":"https://avatars.githubusercontent.com/u/987837?v=3","gravatar_id":"","url":"https://api.github.com/users/malmaud","html_url":"https://github.com/malmaud","followers_url":"https://api.github.com/users/malmaud/followers","following_url":"https://api.github.com/users/malmaud/following{/other_user}","gists_url":"https://api.github.com/users/malmaud/gists{/gist_id}","starred_url":"https://api.github.com/users/malmaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malmaud/subscriptions","organizations_url":"https://api.github.com/users/malmaud/orgs","repos_url":"https://api.github.com/users/malmaud/repos","events_url":"https://api.github.com/users/malmaud/events{/privacy}","received_events_url":"https://api.github.com/users/malmaud/received_events","type":"User","site_admin":false},"body":"Alright, I'm no longer caching the capture names in the regex table. The only time memory is allocated now is when ``show`` is called on a ``Match`` object.","created_at":"2015-06-24T14:55:45Z","updated_at":"2015-06-24T14:55:45Z","html_url":"https://github.com/JuliaLang/julia/pull/11566#discussion_r33155718","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11566","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/33155718"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11566#discussion_r33155718"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11566"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11566","id":36879326,"html_url":"https://github.com/JuliaLang/julia/pull/11566","diff_url":"https://github.com/JuliaLang/julia/pull/11566.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11566.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11566","number":11566,"state":"open","locked":false,"title":"RFC: define getindex on regex matches to return captures.","user":{"login":"malmaud","id":987837,"avatar_url":"https://avatars.githubusercontent.com/u/987837?v=3","gravatar_id":"","url":"https://api.github.com/users/malmaud","html_url":"https://github.com/malmaud","followers_url":"https://api.github.com/users/malmaud/followers","following_url":"https://api.github.com/users/malmaud/following{/other_user}","gists_url":"https://api.github.com/users/malmaud/gists{/gist_id}","starred_url":"https://api.github.com/users/malmaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malmaud/subscriptions","organizations_url":"https://api.github.com/users/malmaud/orgs","repos_url":"https://api.github.com/users/malmaud/repos","events_url":"https://api.github.com/users/malmaud/events{/privacy}","received_events_url":"https://api.github.com/users/malmaud/received_events","type":"User","site_admin":false},"body":"Two non-breaking changes to regular expressions related to named capture groups:\r\n* Showing a match object on the REPL will display the name of a named capture group instead of its index\r\n* ``getindex`` on a match object returns the captured substring. The index can either be an integer, in which case it indicates the position of the capture group in the original regex, or a string, in which case it corresponds to the name of a capture group. \r\n\r\nThis introduces no additional overhead to ``match``, since the mapping between capture group names and indices is only computed once, when the regular expression is first compiled. This should address @StefanKarpinski's concern about constructing a ``Dict`` for every ``RegexMatch`` object.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/julialang/julia/11566)\n<!-- Reviewable:end -->\n","created_at":"2015-06-03T21:20:05Z","updated_at":"2015-06-24T14:55:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"814251dfbf80b521e74941b11fb6846a1c898900","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11566/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11566/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11566/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/1b0127cd7af78b5e9a769a667bb17739c19641fd","head":{"label":"malmaud:regex_named_subpattern","ref":"regex_named_subpattern","sha":"1b0127cd7af78b5e9a769a667bb17739c19641fd","user":{"login":"malmaud","id":987837,"avatar_url":"https://avatars.githubusercontent.com/u/987837?v=3","gravatar_id":"","url":"https://api.github.com/users/malmaud","html_url":"https://github.com/malmaud","followers_url":"https://api.github.com/users/malmaud/followers","following_url":"https://api.github.com/users/malmaud/following{/other_user}","gists_url":"https://api.github.com/users/malmaud/gists{/gist_id}","starred_url":"https://api.github.com/users/malmaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malmaud/subscriptions","organizations_url":"https://api.github.com/users/malmaud/orgs","repos_url":"https://api.github.com/users/malmaud/repos","events_url":"https://api.github.com/users/malmaud/events{/privacy}","received_events_url":"https://api.github.com/users/malmaud/received_events","type":"User","site_admin":false},"repo":{"id":15482991,"name":"julia","full_name":"malmaud/julia","owner":{"login":"malmaud","id":987837,"avatar_url":"https://avatars.githubusercontent.com/u/987837?v=3","gravatar_id":"","url":"https://api.github.com/users/malmaud","html_url":"https://github.com/malmaud","followers_url":"https://api.github.com/users/malmaud/followers","following_url":"https://api.github.com/users/malmaud/following{/other_user}","gists_url":"https://api.github.com/users/malmaud/gists{/gist_id}","starred_url":"https://api.github.com/users/malmaud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malmaud/subscriptions","organizations_url":"https://api.github.com/users/malmaud/orgs","repos_url":"https://api.github.com/users/malmaud/repos","events_url":"https://api.github.com/users/malmaud/events{/privacy}","received_events_url":"https://api.github.com/users/malmaud/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/malmaud/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/malmaud/julia","forks_url":"https://api.github.com/repos/malmaud/julia/forks","keys_url":"https://api.github.com/repos/malmaud/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/malmaud/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/malmaud/julia/teams","hooks_url":"https://api.github.com/repos/malmaud/julia/hooks","issue_events_url":"https://api.github.com/repos/malmaud/julia/issues/events{/number}","events_url":"https://api.github.com/repos/malmaud/julia/events","assignees_url":"https://api.github.com/repos/malmaud/julia/assignees{/user}","branches_url":"https://api.github.com/repos/malmaud/julia/branches{/branch}","tags_url":"https://api.github.com/repos/malmaud/julia/tags","blobs_url":"https://api.github.com/repos/malmaud/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/malmaud/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/malmaud/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/malmaud/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/malmaud/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/malmaud/julia/languages","stargazers_url":"https://api.github.com/repos/malmaud/julia/stargazers","contributors_url":"https://api.github.com/repos/malmaud/julia/contributors","subscribers_url":"https://api.github.com/repos/malmaud/julia/subscribers","subscription_url":"https://api.github.com/repos/malmaud/julia/subscription","commits_url":"https://api.github.com/repos/malmaud/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/malmaud/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/malmaud/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/malmaud/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/malmaud/julia/contents/{+path}","compare_url":"https://api.github.com/repos/malmaud/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/malmaud/julia/merges","archive_url":"https://api.github.com/repos/malmaud/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/malmaud/julia/downloads","issues_url":"https://api.github.com/repos/malmaud/julia/issues{/number}","pulls_url":"https://api.github.com/repos/malmaud/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/malmaud/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/malmaud/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/malmaud/julia/labels{/name}","releases_url":"https://api.github.com/repos/malmaud/julia/releases{/id}","created_at":"2013-12-27T22:21:53Z","updated_at":"2014-04-15T19:19:33Z","pushed_at":"2015-06-24T14:54:26Z","git_url":"git://github.com/malmaud/julia.git","ssh_url":"git@github.com:malmaud/julia.git","clone_url":"https://github.com/malmaud/julia.git","svn_url":"https://github.com/malmaud/julia","homepage":"http://julialang.org/","size":68290,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaLang:master","ref":"master","sha":"f3a6461215ba2f8ce4a7ace7923503aa6f8f6ecb","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","created_at":"2011-04-21T07:01:50Z","updated_at":"2015-06-24T04:01:16Z","pushed_at":"2015-06-24T14:54:29Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":196796,"stargazers_count":5712,"watchers_count":5712,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1199,"mirror_url":null,"open_issues_count":1307,"forks":1199,"open_issues":1307,"watchers":5712,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11566"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11566"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11566"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11566/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11566/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11566/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/1b0127cd7af78b5e9a769a667bb17739c19641fd"}}}}