Skip to content

Instantly share code, notes, and snippets.

@dylan-chong
Created January 9, 2018 23:10
Show Gist options
  • Save dylan-chong/14a4d88aafb85794ca39f04bda8df708 to your computer and use it in GitHub Desktop.
Save dylan-chong/14a4d88aafb85794ca39f04bda8df708 to your computer and use it in GitHub Desktop.
Perl find and replace across multiple lines
# File
echo 'A' > test-file
echo 'B' >> test-file
perl -i -0 -pe 's/A\nB/REPLACEMENT/g' test-file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment