ruby-changes:26516
From: zzak <ko1@a...>
Date: Sun, 23 Dec 2012 14:53:00 +0900 (JST)
Subject: [ruby-changes:26516] zzak:r38567 (trunk): * re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added example
zzak 2012-12-23 14:52:50 +0900 (Sun, 23 Dec 2012) New Revision: 38567 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38567 Log: * re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added example [ruby-dev:46746] [Bug #7571] Modified files: trunk/ChangeLog trunk/re.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38566) +++ ChangeLog (revision 38567) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun Dec 23 14:52:00 2012 Zachary Scott <zachary@z...> + + * re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added example + [ruby-dev:46746] [Bug #7571] + Sun Dec 23 14:35:13 2012 Nobuyoshi Nakada <nobu@r...> * thread.c (BLOCKING_REGION): if fail_if_interrupted is false ignore Index: re.c =================================================================== --- re.c (revision 38566) +++ re.c (revision 38567) @@ -2760,7 +2760,7 @@ rb_reg_match(VALUE re, VALUE str) https://github.com/ruby/ruby/blob/trunk/re.c#L2760 * call-seq: * rxp === str -> true or false * - * Case Equality---Synonym for <code>Regexp#=~</code> used in case statements. + * Case Equality---Used in case statements. * * a = "HELLO" * case a @@ -2768,10 +2768,13 @@ rb_reg_match(VALUE re, VALUE str) https://github.com/ruby/ruby/blob/trunk/re.c#L2768 * when /^[A-Z]*$/; print "Upper case\n" * else; print "Mixed case\n" * end + * #=> "Upper case" * - * <em>produces:</em> + * Following a regular expression literal with the #=== operator allows you to + * compare against a String. * - * Upper case + * /^[a-z]*$/ === "HELLO" #=> false + * /^[A-Z]*$/ === "HELLO" #=> true */ VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/