I want to do a non greedy regex replace on a text file. But “sed” does not work.
“perl” is suitable for this:
out of place:
perl -pe 's|textA.+?textB|textC|g' file
in place:
perl -pe 's|textA.+?textB|textC|g' file
I want to do a non greedy regex replace on a text file. But “sed” does not work.
“perl” is suitable for this:
out of place:
perl -pe 's|textA.+?textB|textC|g' file
in place:
perl -pe 's|textA.+?textB|textC|g' file