I have the following regular expression that is supposed to match all words that have parenthesis around them (including the parenthesis) but it only matches one case. What am I doing wrong?
"(e), (f), and (g)".match(/\(\w+\)/)
=> #<MatchData "(e)">
The output should be:
=> #<MatchData "(e)", 1: "(f)", 2: "(g)">