[前][次][番号順一覧][スレッド一覧]

ruby-changes:72243

From: Nobuyoshi <ko1@a...>
Date: Mon, 20 Jun 2022 09:29:45 +0900 (JST)
Subject: [ruby-changes:72243] cd3a5cd0e3 (master): [DOC] Fixed omissions in Regexp.new arguments

https://git.ruby-lang.org/ruby.git/commit/?id=cd3a5cd0e3

From cd3a5cd0e33f7b2495c5b3421e7f1d124de8c343 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 20 Jun 2022 02:32:17 +0900
Subject: [DOC] Fixed omissions in Regexp.new arguments

---
 re.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/re.c b/re.c
index 2093d1ace4..6a6aa69cec 100644
--- a/re.c
+++ b/re.c
@@ -3633,8 +3633,8 @@ rb_reg_match_p(VALUE re, VALUE str, long pos) https://github.com/ruby/ruby/blob/trunk/re.c#L3633
 
 /*
  *  call-seq:
- *    Regexp.new(string, options = 0, timeout: nil) -> regexp
- *    Regexp.new(regexp) -> regexp
+ *    Regexp.new(string, options = 0, encoding = nil, timeout: nil) -> regexp
+ *    Regexp.new(regexp, timeout: nil) -> regexp
  *
  *  With argument +string+ given, returns a new regexp with the given string
  *  and options:
@@ -3656,6 +3656,10 @@ rb_reg_match_p(VALUE re, VALUE str, long pos) https://github.com/ruby/ruby/blob/trunk/re.c#L3656
  *
  *  - +nil+ or +false+, which is ignored.
  *
+ *  If optional argument +encoding+ is a string starts with
+ *  <code>'n'</code>, the encoding of +string+ is ignored and the new
+ *  regexp encoding is fixed to +ASCII_8BIT+.
+ *
  *  If optional keyword argument +timeout+ is given,
  *  its integer value overrides the timeout interval for the class,
  *  Regexp.timeout.
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]