{"action":"closed","issue":{"url":"https://api.github.com/repos/opal/opal/issues/1580","repository_url":"https://api.github.com/repos/opal/opal","labels_url":"https://api.github.com/repos/opal/opal/issues/1580/labels{/name}","comments_url":"https://api.github.com/repos/opal/opal/issues/1580/comments","events_url":"https://api.github.com/repos/opal/opal/issues/1580/events","html_url":"https://github.com/opal/opal/issues/1580","id":187888334,"number":1580,"title":"nested regexes broken","user":{"login":"patrickkettner","id":465414,"avatar_url":"https://avatars.githubusercontent.com/u/465414?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickkettner","html_url":"https://github.com/patrickkettner","followers_url":"https://api.github.com/users/patrickkettner/followers","following_url":"https://api.github.com/users/patrickkettner/following{/other_user}","gists_url":"https://api.github.com/users/patrickkettner/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickkettner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickkettner/subscriptions","organizations_url":"https://api.github.com/users/patrickkettner/orgs","repos_url":"https://api.github.com/users/patrickkettner/repos","events_url":"https://api.github.com/users/patrickkettner/events{/privacy}","received_events_url":"https://api.github.com/users/patrickkettner/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-08T02:49:53Z","updated_at":"2016-11-28T04:51:36Z","closed_at":"2016-11-28T04:51:36Z","body":"simplified example\r\n\r\n```ruby\r\n/#{Regexp.union [\".\", \"#\"]}foo/\r\n```\r\nThis should create something like `/(\\.|\\#)foo/` - a literal dot or a literal octothorpe followed by the string foo. Opal's union, however,  adds the surrounding `/`s so it ends up being `/(\\/\\.|\\#\\/)foo/`.\r\n\r\nFor the moment, I am working around this by changing the original ruby do be more like\r\n\r\n```ruby\r\n/#{[\".\", \"#\"].map {|v| Regexp.union v}.join('|'}foo/\r\n```\r\n\r\nsuper gross looking, but gets the correct result in ruby and opal\r\n\r\nI took a peak at the regex.rb in opal, but am not sure how to properly add statefulness to the union code (or if that is even the right way to go about fixing this). Hapy to do the grunt work, but would need guidance on the proper way forward"}}
{"actor":{"display_login":"patrickkettner"}}