title: RegExp help: How do I find a match for a character that has a particular character coming before it?
body: <p>I'm actually trying to delete every space in a small function statement excepted if the word "function" or "return" comes before it. This is what I tried but to no avail:</p>
  
  <pre><code>function hi() {
      return "Hello";
  }
  hi.toString().replace(/\b\s+?=(return|function)/g, '');
  </code></pre>