title: Regex any characters except some
body: <p>Im trying to create a regex to catch [[xyz|asd]], but not [[xyz]]
  In the text:</p>
  
  <p><code>'''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]].</code></p>
  
  <p>The following results should be captured:</p>
  
  <pre><code>[[The Office (U.S. season 1)]|first season]] &lt;-- 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]]
  </code></pre>
  
  <p>I was trying to use is:</p>
  
  <pre><code>\[\[([^|]+)\|([^|]+)\]\]
  </code></pre>
  
  <p>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)</p>
  
  <p>Please help, thanks!</p>