title: JavaScript how to replace using wildcards
body: <p>I have a string with potentially random characters in it. I wanting to replace all instances of a section with wildcard support. Example:</p>
  
  <pre><code>var input = 'abcdef acbdef acdbef';
  
  input = coolFunction(input, 'a*b', '_'); 
  </code></pre>
  
  <pre><code>// I want to replace every charachter between an a and the next closest b with _'s
  //Output should be '__cdef ___def ____ef'
  </code></pre>
  
  <p>Can someone tell me how I can do this?</p>