Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bed92ee

Browse files
committed
SF patch #800899: Making "|" directive from REs a bit clearer.
1 parent 62685d3 commit bed92ee

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Doc/lib/libre.tex

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
187187
creates a regular expression that will match either A or B. An
188188
arbitrary 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
199198
parentheses, and indicates the start and end of a group; the contents

0 commit comments

Comments
 (0)