|
|
|
|
|
by piekvorst
92 days ago
|
|
That's exactly right. A few unmentioned details: . The dot (".") never matches newlines, which keeps line-oriented
idioms from accidentally spanning newlines [1] . Changes must be sequential and non-overlapping (that's why I deleted
the whole thing before processing in the third example). . Sam matches only the original input, not past changes. . Addresses (expressions before commands) select a single range, x
commands select multiple ranges and loop over it. [1]: https://p9f.org/sys/doc/sam/sam.html, Regular expressions |
|
Also, while i'm learning it, maybe that the sam traduction for the first file would be simpler, like:
,x/\n +/ c/ /