News for hackers. Stuff that matters.
Re:Show HN: Transductive regular expressions for text editing by c0nstantine on Saturday February 08, 2025 @09:57AM (#42983325)
Hi,

If I understand it correctly you want to change something inside the "..." block and change the quotas to single '.

It can be done by this expression:

echo '"hello world" "hello again!"' | ./trre "\":'.+?:-\":'"

'-' '-'

So I substitute the text inside "" by symbol - using this expression ".+?:-" and simultaneously changing the surrounding quota.

Question mark means non-greedy mode.

There are no comments on this comment yet.