How can I delete all lines that do not begin with certain characters?

Viewed 18380

I need to figure out a regular expression to delete all lines that do not begin with either "+" or "-".

I want to print a paper copy of a large diff file, but it shows 5 or so lines before and after the actual diff.

7 Answers
Related