It matches string to a regular expression.
'hello' =~ /^h/ # => 0
If there is no match, it will return nil
. If you pass it invalid arguments (ie, left or right-hand sides are not correct), it will either throw a TypeError
or return false
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…