@@ -186,14 +186,13 @@ \subsection{Regular Expression Syntax \label{re-syntax}}
186186\item [\character {|}]\code {A|B}, where A and B can be arbitrary REs,
187187creates a regular expression that will match either A or B. An
188188arbitrary number of REs can be separated by the \character {|} in this
189- way. This can be used inside groups (see below) as well. REs
190- separated by \character {|} are tried from left to right, and the first
191- one that allows the complete pattern to match is considered the
192- accepted branch. This means that if \code {A} matches, \code {B} will
193- never be tested, even if it would produce a longer overall match. In
194- other words, the \character {|} operator is never greedy. To match a
195- literal \character {|}, use \regexp {\e |}, or enclose it inside a
196- character class, as in \regexp {[|]}.
189+ way. This can be used inside groups (see below) as well. As the target
190+ string is scanned, REs separated by \character {|} are tried from left to
191+ right. When one pattern completely matches, that branch is accepted.
192+ This means that once \code {A} matches, \code {B} will not be tested further,
193+ even if it would produce a longer overall match. In other words, the
194+ \character {|} operator is never greedy. To match a literal \character {|},
195+ use \regexp {\e |}, or enclose it inside a character class, as in \regexp {[|]}.
197196
198197\item [\code {(...)}] Matches whatever regular expression is inside the
199198parentheses, and indicates the start and end of a group; the contents
0 commit comments