title: How to match an exact word through SPARQL
body: <p>My application needs to match the correct word i.e. say C or C++ with SPARQL. I have the following SPARQL query</p>
  
  <pre><code>String prolog = "PREFIX kb: &lt;" + VBOOK.getURI() + "&gt;";
  
  String queryString = prolog
  
  + "\n"
  
  + "SELECT * "
  
  + "WHERE {?x kb:Price ?price. ?x kb:Currency ?currency. ?x kb:Title ?title. ?x kb:Count ?count. "
  
  + "OPTIONAL {?x kb:Description ?description}."
  
  + "FILTER regex(?title, \"" +title + "\")}";
  </code></pre>
  
  <p>This matches me all books even C++,C# and books like -Real Concepts in Embedded Systems (because of the word 'Concepts' having 'C').</p>
  
  <p>if I change the last line to</p>
  
  <pre><code>+ "FILTER regex(?title, \"" +"^"+title + "\")}";
  </code></pre>
  
  <p>and if title is for example 'C' then my query matches only those books whose titles start with letter 'C'.So books like 'Programming in ANSI C' are not selected.</p>
  
  <p>I have also tried with the following change in the last line</p>
  
  <pre><code>+ "FILTER regex(str(?title), \"" +title + "\")}";
  </code></pre>
  
  <p>Even this has not helped me much.</p>
  
  <p>How do I modify to get the books pertaining to 'C' even if the books title do not start with C?</p>
  
  <p>Regards,
  Archana.</p>