Support for -o (--only-matching), which prints only the matching part of
each line. This is based on the earlier pull request from @JSmith-BitFlipper.

Fixes #231, #400 and #454.