title: How can characters be escaped in programmatic search in Word Add-ins?
body: <p>Let's say my code in a Word Web Add-in needs to find strings that consist of a pair of [], with any number of characters between them, followed by a pair of () with any number of characters between them. Since the [,],(, and ) are special characters in RegEx (which Word calls "wildcard search" in its UI), they need to be escaped. The following works fine when I do a wildcard search in the UI:</p>
  
  <pre><code>\[*\]\(*\)
  </code></pre>
  
  <p>But when I'm using one of the search() functions in Office.js, such as this:</p>
  
  <pre><code>var searchResults = context.document.body.search('\[*\]\(*\)');
  </code></pre>
  
  <p>I get only the ranges that consist of a single "*" character.</p>
  
  <p>So, how do I escape characters programmatically? </p>