title: Match all characters up until a word boundary
body: <p>Based off <a href="https://stackoverflow.com/q/3850074/1366033">Regex Until But Not Including</a>, I'm trying to match all characters up until a word boundary.  </p>
  
  <p>For example - matching <code>apple</code> in the following string:</p>
  
  <pre><code><b>apple</b>&lt;
  </code></pre>
  
  <p>I'm doing that using: </p>
  
  <ul>
  <li>a <a href="http://www.regular-expressions.info/charclass.html" rel="nofollow noreferrer"><strong>negated set</strong></a> <code>[^]</code> </li>
  <li>with a <a href="http://www.regular-expressions.info/wordboundaries.html" rel="nofollow noreferrer"><strong>word boundary</strong></a> <code>\b</code></li>
  <li>and a plus <code>+</code> <a href="http://www.regular-expressions.info/repeat.html" rel="nofollow noreferrer"><strong>repeater</strong></a></li>
  </ul>
  
  <p>Like this:</p>
  
  <pre><code>/a[^\b]+/
  </code></pre>
  
  <p>Which should look for an "a" and then grab one or more matches for any character that is not a word boundary.  So I would expect it to stop before <code>&lt;</code> which is at the end of the word</p>
  
  <h3><a href="http://regexr.com/3aruv" rel="nofollow noreferrer">Demo in Regexr</a></h3>
  
  <h3>Demo in StackSnippets</h3>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var input = [ "apple&lt;", "apple/" ];
  var myRegex = /a[^\b]+/;
  
  for (var i = 0; i &lt; input.length; i++) {
    console.log(myRegex.exec(input[i]));  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Couple other regex strings I tried:</p>
  
  <p>I can use a negated word boundary or a negated set with a regular word boundary:</p>
  
  <ul>
  <li><code>/a[\B]+/</code></li>
  <li><code>/a[^\b]+/</code></li>
  </ul>
  
  <p>I can specify several possible word ending characters and use them in a negated set:</p>
  
  <ul>
  <li><code>/a[^|"&lt;&gt;\-\\\/;:,.]+/</code></li>
  </ul>
  
  <p>I can also look for a postive set and just restrict it to return for regular letters:</p>
  
  <ul>
  <li><code>/a[\w]+/</code></li>
  <li><code>/a[a-zA-Z]+/</code></li>
  </ul>
  
  <p>But I'd like to know how to do it for a word boundary if that's possible.  </p>
  
  <p>Here's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#special-word-boundary" rel="nofollow noreferrer">MDN's listing of word boundary</a> and the <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.10.2.6" rel="nofollow noreferrer">characters that it constitutes</a></p>