Ruby 2.4

RegexpError

RegexpError类

Parent:StandardError

当给出无效的正则表达式时引发。

Regexp.new("?")

引发了一个例外:

RegexpError: target of repeat operator is not specified: /?/