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:
parent
e8ccf9f758
commit
210f2cc7e8
1 changed files with 3 additions and 3 deletions
6
re.c
6
re.c
|
@ -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"
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue