{"action":"created","issue":{"url":"https://api.github.com/repos/jruby/jruby/issues/2998","labels_url":"https://api.github.com/repos/jruby/jruby/issues/2998/labels{/name}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/2998/comments","events_url":"https://api.github.com/repos/jruby/jruby/issues/2998/events","html_url":"https://github.com/jruby/jruby/issues/2998","id":81971312,"number":2998,"title":"CRITICAL! Regular expression hang with string containing umlaut characters","user":{"login":"pinnamur","id":2413570,"avatar_url":"https://avatars.githubusercontent.com/u/2413570?v=3","gravatar_id":"","url":"https://api.github.com/users/pinnamur","html_url":"https://github.com/pinnamur","followers_url":"https://api.github.com/users/pinnamur/followers","following_url":"https://api.github.com/users/pinnamur/following{/other_user}","gists_url":"https://api.github.com/users/pinnamur/gists{/gist_id}","starred_url":"https://api.github.com/users/pinnamur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinnamur/subscriptions","organizations_url":"https://api.github.com/users/pinnamur/orgs","repos_url":"https://api.github.com/users/pinnamur/repos","events_url":"https://api.github.com/users/pinnamur/events{/privacy}","received_events_url":"https://api.github.com/users/pinnamur/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jruby/jruby/labels/core","name":"core","color":"02e10c"},{"url":"https://api.github.com/repos/jruby/jruby/labels/encoding","name":"encoding","color":"671716"},{"url":"https://api.github.com/repos/jruby/jruby/labels/JRuby%201.7.x","name":"JRuby 1.7.x","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jruby/jruby/milestones/33","html_url":"https://github.com/jruby/jruby/milestones/JRuby%201.7.21","labels_url":"https://api.github.com/repos/jruby/jruby/milestones/33/labels","id":958668,"number":33,"title":"JRuby 1.7.21","description":"","creator":{"login":"enebo","id":19819,"avatar_url":"https://avatars.githubusercontent.com/u/19819?v=3","gravatar_id":"","url":"https://api.github.com/users/enebo","html_url":"https://github.com/enebo","followers_url":"https://api.github.com/users/enebo/followers","following_url":"https://api.github.com/users/enebo/following{/other_user}","gists_url":"https://api.github.com/users/enebo/gists{/gist_id}","starred_url":"https://api.github.com/users/enebo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enebo/subscriptions","organizations_url":"https://api.github.com/users/enebo/orgs","repos_url":"https://api.github.com/users/enebo/repos","events_url":"https://api.github.com/users/enebo/events{/privacy}","received_events_url":"https://api.github.com/users/enebo/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":13,"state":"open","created_at":"2015-01-30T18:43:27Z","updated_at":"2015-05-29T08:36:59Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-05-28T15:04:03Z","updated_at":"2015-05-29T18:29:11Z","closed_at":null,"body":"If the string contain umlaut characters, then JRuby hangs while trying to match the regular expression pattern. The below code snippet always hang with JRuby 1.7.20\r\n\r\n```\r\npublic class RubyRegexTest\r\n{\r\n\r\n\tpublic static void main(String[] args)\r\n\t{\r\n\t\t// System.out.println(\"ütest\");\r\n\r\n\t\tRuby runtime = Ruby.newInstance();\r\n\t\tString regPattern = \"(?-mix:^(.*\\\\*\\\\/)?\\\\s*(\\\\}|\\\\))([^{]*\\\\{)?([;,]?\\\\s*|\\\\.[^{]*|\\\\s*\\\\)[;\\\\s]*)$)\";\r\n\t\tRubyRegexp regexp = RubyRegexp.newRegexp(runtime, regPattern, new RegexpOptions(KCode.UTF8, true));\r\n\r\n\t\tSystem.out.println(matchesRegexp(regexp, \"console.log('testü');\"));\r\n\t\tSystem.out.println(\"Done!\");\r\n\r\n\t}\r\n\r\n\tprotected static boolean matchesRegexp(RubyRegexp regexp, String lineContent)\r\n\t{\r\n\t\tif (regexp == null)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tRuby runtime = regexp.getRuntime();\r\n\t\tRubyString string = runtime.newString(lineContent);\r\n\t\tIRubyObject matcher = regexp.match_m(regexp.getRuntime().getCurrentContext(), string);\r\n\t\treturn !matcher.isNil();\r\n\t}\r\n\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/jruby/jruby/issues/comments/106897670","html_url":"https://github.com/jruby/jruby/issues/2998#issuecomment-106897670","issue_url":"https://api.github.com/repos/jruby/jruby/issues/2998","id":106897670,"user":{"login":"pinnamur","id":2413570,"avatar_url":"https://avatars.githubusercontent.com/u/2413570?v=3","gravatar_id":"","url":"https://api.github.com/users/pinnamur","html_url":"https://github.com/pinnamur","followers_url":"https://api.github.com/users/pinnamur/followers","following_url":"https://api.github.com/users/pinnamur/following{/other_user}","gists_url":"https://api.github.com/users/pinnamur/gists{/gist_id}","starred_url":"https://api.github.com/users/pinnamur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinnamur/subscriptions","organizations_url":"https://api.github.com/users/pinnamur/orgs","repos_url":"https://api.github.com/users/pinnamur/repos","events_url":"https://api.github.com/users/pinnamur/events{/privacy}","received_events_url":"https://api.github.com/users/pinnamur/received_events","type":"User","site_admin":false},"created_at":"2015-05-29T18:29:11Z","updated_at":"2015-05-29T18:29:11Z","body":"@headius Thanks for your suggestions. We will definitely incorporate the 1.9 mode encoding since we moved to JRuby 1.7."}}