1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Regexp#===: Use \A and \z instead of ^ and $

[ci skip]
ref https://github.com/rurema/doctree/pull/812

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2017-11-16 03:32:23 +00:00
parent e8ccf9f758
commit 210f2cc7e8

6
re.c
View file

@ -3156,9 +3156,9 @@ rb_reg_match(VALUE re, VALUE str)
*
* 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"
*