Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Regex character class crash #2003

wjessop opened this Issue · 3 comments

2 participants


MRI 1.9.3: works OK
rbx 1.8: Raises RegexpError
rbx 1.9: rbx crashes

Full output:


$ rbx -e '"anything".match /[^\u{20}-\u{7E}]/'
Fatal ONIG error: empty range in char class
Assertion failed: (err == ONIG_NORMAL), function maybe_recompile, file vm/builtin/regexp.cpp, line 236.


@wjessop thanks for tracking this down. The regexp is invalid in Ruby 1.8. I'll fix Rubinius 1.9 mode, though.


@wjessop any chance I could see the actual code for this? The example works fine in a script. It fails in a -e because we were not setting the encoding of the string read from ARGV apparently.


If you put '# encoding: utf-8' at the beginning of the file rbx crashes:

# encoding: utf-8
"anything".match /[^\u{20}-\u{7E}]/

The original code is found here:

@brixen brixen closed this in 6eaadc1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.