perl
The Perl 5 language interpreter. See also:
perldoc. More information: https://perldoc.perl.org/perl.
- Print lines from
stdin[m]atchingregex1and case [i]nsensitiveregex2:
perl -n -e 'print if m/regex1/ and m/regex2/i'
- Say ([-E]) first match group, using a
regex, ignoring space ([x]) inregex:
perl -n -E 'say $1 if m/ ( ) /x'
- [i]n-place, with backup, [s]ubstitute all occurrence ([g]) of
regexwith a replacement:
perl -i'.bak' -p -e 's/regex//g'
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
