Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Perl match newline in `-0` mode
- I've got a loverly bunch of coconut trees.
- Newlines!
- Bahahaha
- Newlines!
- the end.
- I've got a loverly bunch of coconut trees.
- NEWLINES!
- Bahahaha
- Newlines!
- the end.
- perl -p -e 's@Newlines!@NEWLINES!@g' input.txt
- perl -p -e 's@nNewlines!n@nNEWLINES!n@g' input.txt
- perl -p -e 's@(?<=n)Newlines!(?=n)@NEWLINES!@g' input.txt
- perl -0p -e 's@(?<=n)Newlines!(?=n)@NEWLINES!@g' input.txt
- perl -0p -e 's@(?<= )Newlines!(?= )@NEWLINES!@g' input.txt
- perl -0pe 's@(?<=nn)Newlines!(?=nn)@NEWLINES!@g'
- perl -0p -i.bk -e 's/nnNewlines!nn/nnNEWLINES!nn/g' input.txt
- perl -0777 -pe 's/nnNewlines!(?=nn)/nnNEWLINES!/g'
- perl -ne 'push @buffer, $_; $buffer[1] = "NEWLINES!n" if @buffer == 3 && '
- -e 'join("", @buffer) eq "nNewlines!nn"; '
- -e 'print shift @buffer if @buffer == 3; END { print @buffer }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement