title: SQL Text Search - EXACT before space, LIKE after in search term
body: <p>I'm trying to create a SQL query which will supply values for auto completion for a text field.  Everything is working however I can't seem to create an SQL query which is exact enough for the purposes I want.  I am using MySQL.</p>
  
  <p>If there is a space (or multiple spaces) in the search term, I only want the query to do a LIKE comparison on the part of the string after the last space.</p>
  
  <p>For example, say I have two possible values in the database:</p>
  
  <ul>
  <li>Bolt</li>
  <li>Bolts Large</li>
  </ul>
  
  <p>Currently if the user types 'Bolt' then a space, both values above are returned using this query -</p>
  
  <pre><code>SELECT name FROM items WHERE name LIKE 'SEARCH_TERM%'
  </code></pre>
  
  <p>What I want is that if the user types 'Bolt' then a space, then only Bolt is returned from the database.</p>
  
  <p>Effectively meaning that only the last part of the search term after the space is compared using LIKE, the results should match exactly up until the last space.</p>
  
  <p>I've also tried:</p>
  
  <pre><code>SELECT name FROM items WHERE name LIKE 'SEARCH_TERM[a-z]%'
  </code></pre>
  
  <p>But that actually returns no results using the above scenario.</p>
  
  <p>Is what I'm after possible? I've also tried to explore using Full Text Search but have had no look with that. I believe full text search is enabled on the name field, however I have limited experience with this.  The query below didn't work.</p>
  
  <pre><code>SELECT name FROM items WHERE MATCH(name) AGAINST('SEARCH_TERM')
  </code></pre>
  
  <p>Any advice or points would be very appreciated.</p>