|
|
|
|
|
by c0nstantine
490 days ago
|
|
>> E.g. what if I want to turn xyz into zYx? echo 'zyx' | ./trre 'xy:Yz|zy:Yx' It is still a regular language. I do not introduce references. You are right in sense the `sed` is far superior editor. But here I see some advantages:
- the current implementation is super small; it is direct translation to an automaton
- the complex patterns may be compiled in a more efficient way using deterministic transducer. I can't defend this claim now but I have some evidences
- there are some tricks you can do using 'generative' part of it, e.g. and you even can find levenshtein distance of 1 between two strings just by generating substitutions/insertions/deletions and implement a simple spell checker. Overall, I think you have a good point. Maybe it is just marginal improvement (if any). It was more comfortable to write in this style instead of group usage. I used it for some time and found it handy (especially as extended `tr`). |
|