4 ms·
I still create scripts that include bits like `perl -pe 's/foo/bar/g'` Is there anything else present on most machines that offers as much regex-fu as perl?
by clipradiowallet 5y ago
I still create scripts that include bits like
`perl -pe 's/foo/bar/g'`
Is there anything else present on most machines that offers as much regex-fu as perl?
- dredmorbius 5y agoFor examples such as that, sed and awk will do you fine for POSIX / GNU regex. For perlre, probably not.
- teddyh 5y agoTo quote Eric Raymond: “Perl still has its uses. For tiny projects (100 lines or fewer) that involve a lot of text pattern matching, I am still more likely to tinker up a Perl-regexp-based solution […] Actually, these are much like the things Perl did in its original role as a sort of combination awk/sed/grep/sh, before it had functions and direct access to the operating system API.” — https://www.linuxjournal.com/article/3882 https://www.linuxjournal.com/article/3882 Personally, I write these kind of things in actual awk, sed, and shell script. If these are not sufficient, I skip Perl altogether and go directly to some modern higher-level language.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]