ruby-changes:48668
From: kazu <ko1@a...>
Date: Thu, 16 Nov 2017 12:32:28 +0900 (JST)
Subject: [ruby-changes:48668] kazu:r60784 (trunk): Regexp#===: Use `\A` and `\z` instead of `^` and `$`
kazu 2017-11-16 12:32:23 +0900 (Thu, 16 Nov 2017) New Revision: 60784 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60784 Log: Regexp#===: Use `\A` and `\z` instead of `^` and `$` [ci skip] ref https://github.com/rurema/doctree/pull/812 Modified files: trunk/re.c Index: re.c =================================================================== --- re.c (revision 60783) +++ re.c (revision 60784) @@ -3156,9 +3156,9 @@ rb_reg_match(VALUE re, VALUE str) https://github.com/ruby/ruby/blob/trunk/re.c#L3156 * * a = "HELLO" * case a - * when /^[a-z]*$/; print "Lower case\n" - * when /^[A-Z]*$/; print "Upper case\n" - * else; print "Mixed case\n" + * when /\A[a-z]*\z/; print "Lower case\n" + * when /\A[A-Z]*\z/; print "Upper case\n" + * else; print "Mixed case\n" * end * #=> "Upper case" * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/