зеркало из https://github.com/github/ruby.git
[DOC] Fixed the description of regexp alternations [ci skip]
This commit is contained in:
Родитель
d6b8819b79
Коммит
e4b68ab700
|
@ -372,8 +372,8 @@ then matches a literal <i>)</i>:
|
|||
|
||||
== Alternation
|
||||
|
||||
The vertical bar metacharacter (<tt>|</tt>) combines two expressions into
|
||||
a single one that matches either of the expressions. Each expression is an
|
||||
The vertical bar metacharacter (<tt>|</tt>) combines several expressions into
|
||||
a single one that matches any of the expressions. Each expression is an
|
||||
<i>alternative</i>.
|
||||
|
||||
/\w(and|or)\w/.match("Feliformia") #=> #<MatchData "form" 1:"or">
|
||||
|
|
Загрузка…
Ссылка в новой задаче