From: Andrew M. Kuchling Date: Thu, 5 Oct 2000 15:22:28 +0000 (+0000) Subject: Document the lookbehind assertions (closing bug#115119) X-Git-Tag: v2.0c1~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9351dd2084262b67d58f2dc7c084bf48353f587d;p=thirdparty%2FPython%2Fcpython.git Document the lookbehind assertions (closing bug#115119) --- diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex index c6eca4d28f90..0c9df2aab4ed 100644 --- a/Doc/lib/libre.tex +++ b/Doc/lib/libre.tex @@ -219,6 +219,21 @@ is a negative lookahead assertion. For example, \regexp{Isaac (?!Asimov)} will match \code{'Isaac~'} only if it's \emph{not} followed by \code{'Asimov'}. +\item[\code{(?<=...)}] Matches if the current position in the string +is preceded by a match for \regexp{...} that ends at the current +position. This is called a positive lookbehind assertion. +\regexp{(?<=abc)def} will match \samp{abcdef}, since the lookbehind +will back up 3 characters and check if the contained pattern matches. +The contained pattern must only match strings of some fixed length, +meaning that \regexp{abc} or \regexp{a|b} are allowed, but \regexp{a*} +isn't. + +\item[\code{(?