diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/fs.md | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -703,10 +703,11 @@ matches at every line start, and `$` may stand just before a `\n` (where it changes nothing). Any other `^` or `$` in such a pattern, `(^|\n)def` or `a\nb$`, is refused, EINVAL, with `bad regular expression: in a pattern with \n, ^ can only come first and $ only just before a \n`, since mvzr would read it as the start or end of the -whole text: never a search that silently finds nothing. Within a line, `^` -inside an alternation (`^def|^ `) matches only where the search starts, so it -works from a line's start (an `x` over lines, a `g` on one) and not from its -middle: an mvzr limit. An expression is +whole text: never a search that silently finds nothing. An alternation +whose every branch starts with `^` (`^def|^ `) finds a line that starts +either way (it is taken as `^(def| )`); one that mixes anchored and +unanchored branches (`^def|x`) is refused, `bad regular expression`, since +mvzr keeps `^` only first. An expression is evaluated from the current address, the range last written to `addr` (or left by the last `data` write, just past it), as acme evaluates it from `w->addr` (xfid.c:446): `.` is that address, not the selection (`dot` is @@ -718,7 +719,7 @@ otherwise wraps to the start of the text; `?re?` and `-/re/` find the last match ending before the range, wrapping to the text's last. The match is the leftmost, but of the alternatives at that place mvzr takes the first that matches where sam takes the longest (`/gam|gamma/` finds `gam`); in a search begun in the -middle of a line, `^` inside an alternation can match there; and in a +middle of a line, `^` inside a group can match there; and in a pattern that spans lines, `^`, `$` and `[^...]` keep mvzr's own meaning. mvzr backtracks without bound of its own (`a?` twenty times then twenty `a`s is 2^20 steps from each place it tries), and a search holds the editor, so pardes patches a |
