3 ms·
I've had a similar experience using the sam [1] text editor in command line mode, basically like a REPL. Filtering and modifying data using sam's "structural re
by marttt 4y ago
I've had a similar experience using the sam [1] text editor in command line mode, basically like a REPL. Filtering and modifying data using sam's "structural regular expressions". Rob Pike, the author of sam, specifically points out in the linked paper that the command language is great for manipulating multi-line "records".
Add the ability to { nest { expressions } } + very flexible file system IO (e.g. pipe selection to an external command and return the result), and you have a really nice recursive querying language. I specifically like it because of how easy it is to refine the query/regex substitution when it didn't yield the expected result.
1: http://doc.cat-v.org/plan_9/4th_edition/papers/sam/ http://doc.cat-v.org/plan_9/4th_edition/papers/sam/ (In particular, scroll to the "Structural Regular Expressions" section.)