3 ms·
Yeah, sam is not universal, but it can solve complex tasks more simply by just running it a few times. The final example already normalizes \n (v/./ c/\n/) in a
by piekvorst 7mo ago
Yeah, sam is not universal, but it can solve complex tasks more simply by just running it a few times. The final example already normalizes \n (v/./ c/\n/) in a single pass, but we can make it even simpler by just writing:
, x/(.+\n)+/ .,+#0-#1 x/\n/ c/ /
, x/\n+/ c/\n/
(I haven’t tested it.)
I’m glad that sam worked out for you. You can learn more from [1] and [2]. If you need any help, you’re always welcome to ask me.
[1]: https://ratfactor.com/papers/sam_tut.pdf https://ratfactor.com/papers/sam_tut.pdf
[2]: https://9p.io/sources/contrib/steve/other-docs/struct-regex.pdf https://9p.io/sources/contrib/steve/other-docs/struct-regex....
- jlp__inf 7mo agothanks, i published an article draft about SAM inspired by your examples (referencing sources / this comment section) Do not hesitate to pin point improvements.