title: regex for unicode with markdown [[WikiLinks]]
body: <p>I'm trying to extend a JS markdown script to auto-add links when text is surrounded with double square brackets (aka wikilinks) for JAPANESE text. Now i have three problems :)</p>
  
  <p>The regex result seems to not give me $1 type match elements when i have unicode being found</p>
  
  <pre><code>raw = "I [[carried-out]] the [[plan]]"
  regex = /\[\[(\w*-*\w*)+\]\]/gm
  s2 = raw.replace( regex, "&lt;a class='link' href='/links/$1'&gt;$1&lt;/a&gt;" )
  console.log("raw:", raw)
  console.log("s2 :", s2)
  
  #&gt; raw: I [[carried-out]] the [[plan]]
  #&gt; s2 : I &lt;a class='link' href='/links/carried-out'&gt;carried-out&lt;/a&gt; the &lt;a class='link' href='/links/plan'&gt;plan&lt;/a&gt;
  
  
  raw = "I [[ひらがな]] the plan [[edit]]"
  regex = /\[\[[\u3040-\u309F]+\]\]/gm
  s2 = raw.replace( regex, "&lt;a class='link' href='/links/$1'&gt;$1&lt;/a&gt;" )
  console.log("raw:", raw)
  console.log("s2 :", s2)
  
  #&gt; raw: I [[ひらがな]] the plan [[edit]]
  #&gt; s2 : I &lt;a class='link' href='/links/$1'&gt;$1&lt;/a&gt; the plan [[edit]]
  </code></pre>
  
  <p>as you can see in the second case the "$1" is not getting interpolated, even though the regex operation is almost identical?</p>
  
  <p>there's a slight difference of the inner matcher:</p>
  
  <pre><code>regex = /\[\[(\u3040-\u309F)+\]\]/gm     # matches but no interpolation
  regex = /\[\[[\u3040-\u309F]+\]\]/gm     # fails to match
  </code></pre>
  
  <p>the difference between [] and () around the match, which I'm not completely clear on:</p>
  
  <pre><code>(\u3040-\u309F)+
  [\u3040-\u309F]+
  </code></pre>
  
  <p>Is there a known issue related to unicode? otherwise if someone could help set me straight on the  issues that would be much appreciated :)</p>
  
  <p>Update: so I need to use [] for ranges, but if I do that, i don't get a match, whereas () does generate some type of match - at least it removes the matched text >.&lt;</p>
  
  <p>Unicode range matches just don't seem to be working as obviously as they should.</p>
  
  <p><code>[unicoderange]+</code> should match one or more unicode items i believe.</p>
  
  <p>Thanks!</p>