diff --git a/doc/regexp.rdoc b/doc/regexp.rdoc index 92c7ecf66e..c6c983d1d9 100644 --- a/doc/regexp.rdoc +++ b/doc/regexp.rdoc @@ -405,6 +405,15 @@ a single one that matches any of the expressions. Each expression is an /\w(and|or)\w/.match("furandi") #=> # /\w(and|or)\w/.match("dissemblance") #=> nil +== Condition + +The (?(cond)yes|no) +syntax matches _yes_ part if _cond_ is captured, otherwise matches _no_ part. +In the case _no_ part is empty, also | can be omitted. + +The _cond_ may be a backreference number or a captured name. A backreference +number is an absolute position, but can not be a relative position. + == Character Properties The \p{} construct matches characters with the named property,