New answers tagged perl
1
vote
Perl RegEx one-liner that outputs all matches from one line of STDIN
python would be much too verbose as a CLI one-liner
For what it is worth, seeing the complex:er perl in @Stéphane's answer...
# copy & paste the following lines into a shell to try it out
echo '&...
5
votes
Accepted
Perl RegEx one-liner that outputs all matches from one line of STDIN
echo '"this text", " ", "is in speech marks"' |
perl -lne 'print for /"(.*?)"/g'
Or:
echo '"this text", " ", "is in speech marks&...
0
votes
How to make Perl half/full width-insensitive regular expressions?
What is the easy way to write /4|4/ ?
Here's a long one-liner:
perl -COA -lwe "@c=('A'..'C','x'..'z','0'..'9'); $rs = sprintf'[%s%s]', join('',@c), join('',map chr 0xfee0+ord, @c); print $rs; $r ...
Top 50 recent answers are included
Related Tags
perl × 1387awk × 461
sed × 421
text-processing × 345
linux × 176
bash × 157
regular-expression × 139
shell-script × 133
grep × 82
shell × 76
scripting × 66
python × 58
files × 31
rename × 30
debian × 28
centos × 26
command-line × 26
ksh × 24
cpan × 22
solaris × 18
csv × 18
find × 17
rhel × 15
apache-httpd × 15
ssh × 14