Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jlp__inf
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
jlp__inf
6mo ago
thanks, i published an article draft about SAM inspired by your examples (referencing sources / this comment section) Do not hesitate to pin point improvements.
2.
▲
by
jlp__inf
6mo ago
and yess, g/PATTERN/ and /v/PATTERN/ are supzr powerful, creating branch conditions based on wether or not they (do not)match a PATTERN. based on what you wrote: i just add trailing \n normalization at the end , x&#
3.
▲
by
jlp__inf
6mo ago
That's a fair analogy, i am taking the feedbacks into account.
4.
▲
by
jlp__inf
6mo ago
Also, i managed to, i think simplify the second example to: 1,$-2 x/./ { a/->/ /./ t . } 1,$-2 { p } q Which taught me a lot, because at first, i did not understand why we would stop at last line
5.
▲
by
jlp__inf
6mo ago
Thanks for those complementary informations. Also, while i'm learning it, maybe that the sam traduction for the first file would be simpler, like: ,x/\n +/ c/ /
6.
▲
by
jlp__inf
6mo ago
Thanks for sharing this, I’m learning a lot from it. So if I understand correctly, it’s selection-based, right? You first select a region, and then you can apply further selections inside it? So you kind of build nested selections to match
7.
▲
by
jlp__inf
6mo ago
Yup, notably the famous %s/PATTERN1/PATTERN2/g, which I suppose comes from sed
8.
▲
by
jlp__inf
6mo ago
Ha, I went the Python → AWK → sed route, just for the sake of learning what was behind those chamanics expressions. Glad I could bring back those memories!
9.
▲
by
jlp__inf
6mo ago
Yep, interesting, do you remember the initial text structure and operatins you would perform on it ?
10.
▲
by
jlp__inf
6mo ago
Hi, I'm the author of the article, and sorry if it felt overly LLM-generated. To clarify: I did spend quite a bit of time diving into `sed` myself (experiments, tests, etc.) and wrote an initial draft in French. I then used ChatGPT to