Nice one from a colleague:
perl -wne 'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}'
I should probably get set up with a snippet library for this kind of thing.
Nice one from a colleague:
perl -wne 'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}'
I should probably get set up with a snippet library for this kind of thing.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
That’s a clever one.
The Perl one-liner I use the most is:
perl -e ‘s/oldtext/newtext/gi’ -i.bak -p /folder/of/files/to/change
just multi-file search and replace. Really the only bit of Perl I use regularly.