Perl is a powerful interpreted programming language.
This page presents some perl scripts.
shell> perl -pe 's/<([^>]*)>/[\1]/g'
one <two> three <4> 5
one [two] three  5
shell> perl -pe 'undef $/;s/NEWTYPE.*?ENDNEWTYPE\s*;//sg' < file.txt
- $/ is the input field separator. Its default value is usually "\n" (new line).
- The ? in .*? make the .* less greedy (as small as possible).
- With the final /s, the dot (.) may represent "\n" (normally it does not).