Method: Regexp#options
- Defined in:
- re.c
#options ⇒ Fixnum
Returns the set of bits corresponding to the options used when creating this Regexp (see Regexp::new for details. Note that additional bits may be set in the returned options: these are used internally by the regular expression code. These extra bits are ignored if the options are passed to Regexp::new.
Regexp::IGNORECASE #=> 1
Regexp::EXTENDED #=> 2
Regexp::MULTILINE #=> 4
/cat/. #=> 128
/cat/ix. #=> 131
Regexp.new('cat', true). #=> 129
Regexp.new('cat', 0, 's'). #=> 384
r = /cat/ix
Regexp.new(r.source, r.) #=> /cat/ix
578 579 580 |
# File 're.c', line 578 static VALUE (re) VALUE re; |