Haven't done regex in awhile, and am a bit rusty.
I'm trying to parse the categories out of a Wikipedia entry. What I need are the individual strings contained in a pattern that starts with two open brackets and ends with two closing brackets.
This query works most of the time -
(\[\[)(?<category>.*[^\]#])([\]])
but has issues when the closing brackets have a comma (',') next to them.
This has the unfortunate result that when parsing the following text -
nlocation = [[Seattle, Washington]], [[United States|USA]]|
it extracts the following for "category"
Seattle, Washington]], [[United States|USA
Clearly, the comma is throwing this off and it is finding the next set. What's the best way to capture every value between open and closed double brackets?