title: Match exact string or first word with Regex in Javascript
body: <p>My goal is to match first word of a string. So when you have string like "Testing line", it would return "Testing" as first word and I can do whatever I want with it. This is what I already have:</p>
  
  <pre><code>elm.html(elm.text().replace(/([^\s]+)/, '&lt;span class="first-word"&gt;$1&lt;/span&gt;'));
  </code></pre>
  
  <p>I have element with text "Demo web" and it returned "<code>&lt;span class="first-word"&gt;Demo&lt;/span&gt; web</code>". So this is OK.</p>
  
  <p><strong>BUT</strong></p>
  
  <p>I also want one exception, when part of string contains "Admin", it would return just that part. What I want to say...</p>
  
  <p>Input: <code>Adminer helps</code> -> <code>&lt;span class="first-word"&gt;Admin&lt;/span&gt;er helps</code></p>
  
  <p>I tried this regex: <code>([Admin|^\s]+)</code> which work OK, but only for this case. It now doesn't work on everyhing else, where "Admin" is not present. Example:</p>
  
  <p>Input: <code>Blabla date</code> -> <code>Blabla&lt;span class="first-word"&gt; d&lt;/span&gt;ate</code></p>
  
  <p>What am I doing wrong? I want to do it just with regex, if it is possible.</p>