title: Using regex to match part of a word or words
body: <p>I'm new to regex and having difficulty with some basic stuff.</p>
  
  <pre><code>var name = "robert johnson";
  var searchTerm = "robert johnson";
  
  if (searchTerm.match(name)) {
      console.log("MATCH");
  }
  </code></pre>
  
  <p>I'd like to try and find something that matches any of the following:</p>
  
  <pre><code>rob, robert, john, johnson, robertjohnson
  </code></pre>
  
  <p>To make the regex simpler, I've already added a .toLowerCase() to both the "name" and the "searchTerm" vars.</p>
  
  <p>What regex needs to be added to searchTerm.match(name) to make this work?</p>
  
  <p><em>Clarification:</em> I'm not just trying to get a test to pass with the 5 examples I gave, I'm trying to come up with some regex where any of those tests will pass. So, for example:</p>
  
  <pre><code>searchTerm.match(name)
  </code></pre>
  
  <p>...needs to change to something like:</p>
  
  <pre><code>searchTerm.match("someRegexVoodooHere"+name+"someMoreRegexVoodooHere")
  </code></pre>
  
  <p>So, if I edit</p>
  
  <pre><code>var searchTerm = "robert johnson";
  </code></pre>
  
  <p>...to be</p>
  
  <pre><code>var searchTerm = "rob";
  </code></pre>
  
  <p>...the same function searchTerm.match directive would work.</p>
  
  <p>Again, I'm new to regex so I hope I'm asking this clearly. Basically I need to write a function that takes any searchTerm (it's not included here, but elsewhere I'm requiring that at least 3 characters be entered) and can check to see if those 3 letters are found, in sequence, in a given string of "firstname lastname".</p>