diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 17:26:38 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 17:26:38 -0700 |
| commit | 8df68fa86959e18b9b1ac2898f5293a6eab91a29 (patch) | |
| tree | f9521de6c289bd34878af2fd1c283efc63808af6 | |
| parent | f8b655dc4d839495086537343899c990684222f8 (diff) | |
Updated build
| -rw-r--r-- | bp.1 | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -224,10 +224,26 @@ over instances of \f[I]skip\f[R] (e.g.\ \f[B]\[ga]\[dq]..\[ga]\[dq] % (\[ga]\[rs].)\f[R]) .TP \f[B]<\f[R] \f[I]pat\f[R] -Just after \f[I]pat\f[R] (lookbehind) +Matches at the current position if \f[I]pat\f[R] matches immediately +before the current position (lookbehind). +Conceptually, you can think of this as creating a file containing only +the \f[I]N\f[R] characters immediately before the current position and +attempting to match \f[I]pat\f[R] on that file, for all values of +\f[I]N\f[R] from the minimum number of characters \f[I]pat\f[R] can +match up to maximum number of characters \f[I]pat\f[R] can match (or the +length of the current line upto the current position, whichever is +smaller). +\f[B]Note:\f[R] For fixed-length lookbehinds, this is quite efficient +(e.g.\ \f[B]<(100\[ga]x)\f[R]), however this could cause performance +problems with variable-length lookbehinds (e.g.\ \f[B]<(\[ga]x +0-100\[ga]y)\f[R]). +Also, it is not advised to use \f[B]\[ha]\f[R], \f[B]\[ha]\[ha]\f[R], +\f[B]\[u2005]*\[u2005]*,\f[BI]o\f[B]\f[BI]r\f[B]\[u2005]*\[u2005]*$\f[R] +inside a lookbehind, as they will match against the edges of the +lookbehind slice. .TP \f[B]>\f[R] \f[I]pat\f[R] -Just before \f[I]pat\f[R] (lookahead) +Matches \f[I]pat\f[R], but does not consume any input (lookahead). .TP \f[B]\[at]\f[R] \f[I]pat\f[R] Capture \f[I]pat\f[R] |
