diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index 06c730058d..9218a75b67 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -541,10 +541,15 @@ options which control how the pattern can match. subexpression level with the (?on-off) construct, which enables options on, and disables options off for the -expression enclosed by the parentheses. +expression enclosed by the parentheses: - /a(?i:b)c/.match('aBc') #=> # - /a(?i:b)c/.match('abc') #=> # + /a(?i:b)c/.match('aBc') #=> # + /a(?-i:b)c/i.match('ABC') #=> nil + +Additionally, these options can also be toggled for the remainder of the +pattern: + + /a(?i)bc/.match('abC') #=> # Options may also be used with Regexp.new: