{"action":"created","issue":{"url":"https://api.github.com/repos/davidblewett/rure-python/issues/5","repository_url":"https://api.github.com/repos/davidblewett/rure-python","labels_url":"https://api.github.com/repos/davidblewett/rure-python/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/davidblewett/rure-python/issues/5/comments","events_url":"https://api.github.com/repos/davidblewett/rure-python/issues/5/events","html_url":"https://github.com/davidblewett/rure-python/issues/5","id":191187086,"number":5,"title":"SyntaxError with multiple unnamed capture groups","user":{"login":"mattdeboard","id":306571,"avatar_url":"https://avatars.githubusercontent.com/u/306571?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdeboard","html_url":"https://github.com/mattdeboard","followers_url":"https://api.github.com/users/mattdeboard/followers","following_url":"https://api.github.com/users/mattdeboard/following{/other_user}","gists_url":"https://api.github.com/users/mattdeboard/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdeboard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdeboard/subscriptions","organizations_url":"https://api.github.com/users/mattdeboard/orgs","repos_url":"https://api.github.com/users/mattdeboard/repos","events_url":"https://api.github.com/users/mattdeboard/events{/privacy}","received_events_url":"https://api.github.com/users/mattdeboard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T04:32:30Z","updated_at":"2016-11-23T04:45:30Z","closed_at":null,"body":"Minimal example:\r\n\r\n```python\r\nimport rure\r\n\r\nptn = u\"(re)|(ger)\"\r\nemail = u\"tony@tiremove_thisger.net\"\r\ngroups = rure.search(ptn, email).groups()\r\n```\r\n\r\n```python_tb\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-30-7f52b4f2c143> in <module>()\r\n      1 ptn = u\"(re)|(ger)\"\r\n      2 email = u\"tony@tiremove_thisger.net\"\r\n----> 3 groups = rure.search(ptn, email).groups()\r\n\r\n/Users/mdeboard/crowdstrike/rure-python/rure/regex.pyc in groups(self, default)\r\n    211         # Exclude the entire match (index 0)\r\n    212         return self.group(*[i for i in range(len(self.captures)) if i > 0],\r\n--> 213                           default=default)\r\n    214 \r\n    215     def groupdict(self, default=None, decode=True):\r\n\r\n/Users/mdeboard/crowdstrike/rure-python/rure/regex.pyc in captures(self)\r\n    173     def captures(self):\r\n    174         if self._captures is None:\r\n--> 175             self._captures = self.re._rure.captures(self.string, self.pos)\r\n    176         return self._captures\r\n    177 \r\n\r\n/Users/mdeboard/crowdstrike/rure-python/rure/decorators.pyc in wrapper(cls_instance, string, *args, **kwargs)\r\n     16         if not isinstance(string, bytes):\r\n     17             raise TypeError(err_msg)\r\n---> 18         return f(cls_instance, string, *args, **kwargs)\r\n     19     return wrapper\r\n     20 \r\n\r\n/Users/mdeboard/crowdstrike/rure-python/rure/lib.pyc in captures(self, haystack, start)\r\n    215                 RureMatch(match.start, match.end)\r\n    216                 for i in range(0, _lib.rure_captures_len(captures))\r\n--> 217                 if _lib.rure_captures_at(captures, i, match)\r\n    218             ])\r\n    219 \r\n\r\nTypeError: __new__() takes exactly 4 arguments (3 given)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/davidblewett/rure-python/issues/comments/262433907","html_url":"https://github.com/davidblewett/rure-python/issues/5#issuecomment-262433907","issue_url":"https://api.github.com/repos/davidblewett/rure-python/issues/5","id":262433907,"user":{"login":"mattdeboard","id":306571,"avatar_url":"https://avatars.githubusercontent.com/u/306571?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdeboard","html_url":"https://github.com/mattdeboard","followers_url":"https://api.github.com/users/mattdeboard/followers","following_url":"https://api.github.com/users/mattdeboard/following{/other_user}","gists_url":"https://api.github.com/users/mattdeboard/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdeboard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdeboard/subscriptions","organizations_url":"https://api.github.com/users/mattdeboard/orgs","repos_url":"https://api.github.com/users/mattdeboard/repos","events_url":"https://api.github.com/users/mattdeboard/events{/privacy}","received_events_url":"https://api.github.com/users/mattdeboard/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T04:45:30Z","updated_at":"2016-11-23T04:45:30Z","body":"For the record, the regex in the example is valid Rust regex, but it definitely behaves differently:\r\n\r\n```rust\r\nextern crate regex;\r\n\r\nuse regex::Regex;\r\n\r\nfn main() {\r\n  let re = Regex::new(r\"(re)|(ger)\").unwrap();\r\n  let pattern = \"tony@tiremove_thisger.net\";\r\n  for cap in re.captures_iter(pattern) {\r\n    println!(\"{}\", cap.at(0).unwrap());\r\n  }\r\n}\r\n```\r\n\r\nRunning the above will yield:\r\n\r\n```\r\nre\r\nger\r\n```"}}
{"actor":{"display_login":"mattdeboard"}}