I have a file that contains multiples strings between parentheses that represents country's names.
This (USA) is a bad text (France)
with countries (Luxembourg) between () (Germany)
Whith multiple (Luxembourg) countries (USA) per line
and some lines without countries
To search (France) and find (Belgique) duplicate
countries (USA)
I want to extract all countries and display each country found on a new line.
What I'm expecting is following
USA
France
Luxembourg
Germany
Luxembourg
USA
France
Belgique
USA
Using a special tool named BS2EDT editor on BS2000 Mainframe, the solution can be
list-string /(?<=\()[^)]+(?=\))/,from=lettre.pays.txt
Using PowerShell, what is the shorter solution ?