Comment

Comment by assafmo

Lately I've started to use Perl instead of sed for replacing text. Its regex support is much better IMO:

  cat a.txt | perl -pe 's/banana-(\d)/papaya-$1/g'
Or in-place:

  perl -i -pe 's/banana-(\d)/papaya-$1/g' a.txt
parent assafmo 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton