Ruby 1.9.3 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > RegexpErrorクラス

class RegexpError

クラスの継承リスト: RegexpError < StandardError < Exception < Object < Kernel < BasicObject

要約

正規表現のコンパイルに失敗したときに発生します。

例:

$ ruby -e 'Regexp.compile("*")'
-e:1:in `initialize': target of repeat operator is not specified: /*/ (RegexpError)
        from -e:1:in `Regexp#compile'
        from -e:1
class RegexpError