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

ruby-changes:46158

From: nobu <ko1@a...>
Date: Fri, 7 Apr 2017 22:26:18 +0900 (JST)
Subject: [ruby-changes:46158] nobu:r58271 (trunk): Use \A and \z to match whole string

nobu	2017-04-07 22:26:12 +0900 (Fri, 07 Apr 2017)

  New Revision: 58271

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58271

  Log:
    Use \A and \z to match whole string

  Modified files:
    trunk/lib/drb/acl.rb
Index: lib/drb/acl.rb
===================================================================
--- lib/drb/acl.rb	(revision 58270)
+++ lib/drb/acl.rb	(revision 58271)
@@ -82,8 +82,7 @@ class ACL https://github.com/ruby/ruby/blob/trunk/lib/drb/acl.rb#L82
     # Creates a Regexp to match an address.
 
     def dot_pat(str)
-      exp = "^" + dot_pat_str(str) + "$"
-      Regexp.new(exp)
+      /\A#{dot_pat_str(str)}\z/
     end
 
     public

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

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