{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/3538","labels_url":"https://api.github.com/repos/jruby/jruby/issues/3538/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/3538/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/3538/events","html_url":"https://github.com/jruby/jruby/issues/3538","id":121905758,"number":3538,"title":"Regexp match raises java.lang.ArrayIndexOutOfBoundsException in numbered backreference","user":{"login":"knu","id":10236,"avatar_url":"https://avatars.githubusercontent.com/u/10236?v=3","gravatar_id":"","url":"https://api.github.com/users/knu","html_url":"https://github.com/knu","followers_url":"https://api.github.com/users/knu/followers","following_url":"https://api.github.com/users/knu/following{/other_user}","gists_url":"https://api.github.com/users/knu/gists{/gist_id}","starred_url":"https://api.github.com/users/knu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knu/subscriptions","organizations_url":"https://api.github.com/users/knu/orgs","repos_url":"https://api.github.com/users/knu/repos","events_url":"https://api.github.com/users/knu/events{/privacy}","received_events_url":"https://api.github.com/users/knu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-13T07:50:59Z","updated_at":"2015-12-14T11:03:35Z","closed_at":null,"body":"Confirmed with JRuby 9.0.4.0 and 1.7.23.\r\n```\r\n% cat a.rb\r\n/^\\s*(\\d+\\.?\\d*)\\s*(?:;(?:\\s*url\\s*=\\s*(['\"]?)(\\S*)\\2)?\\s*)?$/i.match(\"0; url=http://www.drphil.com\")\r\n\r\n# JRuby 9.0.4.0\r\n% jruby -v a.rb\r\njruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 23.3-b01 on 1.7.0_07-b10 +jit [darwin-x86_64]\r\nUnhandled Java exception: java.lang.ArrayIndexOutOfBoundsException: 29\r\njava.lang.ArrayIndexOutOfBoundsException: 29\r\n               length at org/jcodings/specific/UTF8Encoding.java:35\r\n         opBackRefNIC at org/joni/ByteCodeMachine.java:1294\r\n              matchAt at org/joni/ByteCodeMachine.java:261\r\n           matchCheck at org/joni/Matcher.java:304\r\n  searchInterruptible at org/joni/Matcher.java:480\r\n                  run at org/jruby/RubyRegexp.java:271\r\n  executeBlockingTask at org/jruby/RubyThread.java:1337\r\n        matcherSearch at org/jruby/RubyRegexp.java:233\r\n             search19 at org/jruby/RubyRegexp.java:1129\r\n             search19 at org/jruby/RubyRegexp.java:1084\r\n             matchPos at org/jruby/RubyRegexp.java:1060\r\n        match19Common at org/jruby/RubyRegexp.java:1028\r\n            match_m19 at org/jruby/RubyRegexp.java:1014\r\n                 call at org/jruby/internal/runtime/methods/JavaMethod.java:380\r\n         cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:313\r\n                 call at org/jruby/runtime/callsite/CachingCallSite.java:163\r\n                <top> at a.rb:2\r\n  invokeWithArguments at java/lang/invoke/MethodHandle.java:566\r\n                 load at org/jruby/ir/Compiler.java:111\r\n            runScript at org/jruby/Ruby.java:821\r\n            runScript at org/jruby/Ruby.java:813\r\n          runNormally at org/jruby/Ruby.java:751\r\n          runFromMain at org/jruby/Ruby.java:573\r\n        doRunFromMain at org/jruby/Main.java:409\r\n          internalRun at org/jruby/Main.java:304\r\n                  run at org/jruby/Main.java:233\r\n                 main at org/jruby/Main.java:200\r\n\r\n# JRuby 9.0.4.0\r\n% jruby -v a.rb\r\njruby 1.7.23 (1.9.3p551) 2015-11-24 f496dd5 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_07-b10 +jit [darwin-x86_64]\r\nUSASCIIEncoding.java:33:in `length': java.lang.ArrayIndexOutOfBoundsException: 28\r\n        from ByteCodeMachine.java:1285:in `opBackRefNIC'\r\n        from ByteCodeMachine.java:261:in `matchAt'\r\n        from Matcher.java:304:in `matchCheck'\r\n        from Matcher.java:480:in `searchInterruptible'\r\n        from RubyRegexp.java:273:in `run'\r\n        from RubyThread.java:1066:in `executeBlockingTask'\r\n        from RubyRegexp.java:235:in `matcherSearch'\r\n        from RubyRegexp.java:1780:in `search19'\r\n        from RubyRegexp.java:1720:in `matchPos'\r\n        from RubyRegexp.java:1701:in `match19Common'\r\n        from RubyRegexp.java:1680:in `match_m19'\r\n        from RubyRegexp$INVOKER$i$match_m19.gen:-1:in `call'\r\n        from JavaMethod.java:350:in `call'\r\n        from CachingCallSite.java:326:in `cacheAndCall'\r\n        from CachingCallSite.java:170:in `call'\r\n        from a.rb:1:in `__file__'\r\n        from a.rb:-1:in `load'\r\n        from Ruby.java:857:in `runScript'\r\n        from Ruby.java:850:in `runScript'\r\n        from Ruby.java:729:in `runNormally'\r\n        from Ruby.java:578:in `runFromMain'\r\n        from Main.java:393:in `doRunFromMain'\r\n        from Main.java:288:in `internalRun'\r\n        from Main.java:217:in `run'\r\n        from Main.java:197:in `main'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/164410034","html_url":"https://github.com/jruby/jruby/issues/3538#issuecomment-164410034","issue_url":"https://api.github.com/repos/jruby/jruby/issues/3538","id":164410034,"user":{"login":"lopex","id":142285,"avatar_url":"https://avatars.githubusercontent.com/u/142285?v=3","gravatar_id":"","url":"https://api.github.com/users/lopex","html_url":"https://github.com/lopex","followers_url":"https://api.github.com/users/lopex/followers","following_url":"https://api.github.com/users/lopex/following{/other_user}","gists_url":"https://api.github.com/users/lopex/gists{/gist_id}","starred_url":"https://api.github.com/users/lopex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lopex/subscriptions","organizations_url":"https://api.github.com/users/lopex/orgs","repos_url":"https://api.github.com/users/lopex/repos","events_url":"https://api.github.com/users/lopex/events{/privacy}","received_events_url":"https://api.github.com/users/lopex/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T11:03:35Z","updated_at":"2015-12-14T11:03:35Z","body":"https://github.com/jruby/joni/commit/cf9171576de0c7f8070b783569e3dc7d1656ef16"}}