I have a large file, and I'm trying to get all matches of a regular expression from it.
grep -P "foo (b.r)"
Displays all the lines containing «foo b.r», and I'd like to display only what's inside of the brackets.
Pro question: what to do if I have more than one bracket set? For example «foo (b.r) foo (.ar)», and I want the output to consist only of the thing in the first and the second bracket, separated by a separator.
I'm tagging this Perl, because I'm sure I could use «perl -e "..."» - the question to Perl experts, how to write this? It's been ages since I used Perl :)