Extract regular expression group match using grep or sed

I’ve been looking for a GNU/Linux command that matches lines in a text file using a regular expression and extracts a group match for that expression (a sub-match within parenthesis).