diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-20 13:35:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-06-20 19:35:12 +0900 |
commit | 4a6facc2d683d1dbb67ded8a9f4d7cd10a9fd8ad (patch) | |
tree | 61442bcd86525d70af1da765043b2c9fbf5ff5ed /doc | |
parent | 883d13dc4127b5fde617b584ebb89714eac19965 (diff) |
[Feature #18788] [DOC] String options to `Regexp.new`
Co-Authored-By: Janosch Mùˆller <janosch.mueller@betterplace.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6039
Diffstat (limited to 'doc')
-rw-r--r-- | doc/regexp.rdoc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index 2b6a870026..f3844d5729 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -620,6 +620,11 @@ Options may also be used with <tt>Regexp.new</tt>: Regexp.new("abc # Comment", Regexp::EXTENDED) #=> /abc # Comment/x Regexp.new("abc", Regexp::IGNORECASE | Regexp::MULTILINE) #=> /abc/mi + Regexp.new("abc", "i") #=> /abc/i + Regexp.new("abc", "m") #=> /abc/m + Regexp.new("abc # Comment", "x") #=> /abc # Comment/x + Regexp.new("abc", "im") #=> /abc/mi + == Free-Spacing Mode and Comments As mentioned above, the <tt>x</tt> option enables <i>free-spacing</i> |