Im trying to create a regex to catch [[xyz|asd]], but not [[xyz]] In the text:
'''Diversity Day'''" is the second episode of the [[The Office (U.S. season 1)]|first season]] of the American [[comedy]] [[television program|television series]] ''[[The Office (U.S. TV series)|The Office]]'', and the show's second episode overall. Written by [[B. J. Novak]] and directed by [[Ken Kwapis]], it first aired in the United States on March 29, 2005, on [[NBC]]. The episode guest stars ''Office'' consulting producer [[Larry Wilmore]] as [[List_of_characters_from_The_Office_(US)#Mr._Brown|Mr. Brown]].
The following results should be captured:
[[The Office (U.S. season 1)]|first season]] <-- keep in mind of the "]" before "|", "]" in that case is a literal character not a breaking one "]]"
[[television program|television series]]
[[The Office (U.S. TV series)|The Office]]
[[List_of_characters_from_The_Office_(US)#Mr._Brown|Mr. Brown]]
I was trying to use is:
\[\[([^|]+)\|([^|]+)\]\]
but i cant figure out how to ignore both "|" and "]]" in the groups. [^|(]])] wont work because it wont match "]]" but only the character "]" (it needs to be the whole word)
Please help, thanks!