title: xQuery LIKE-operator?
body: <p>Is there any way to perform a LIKE operation with XQuery in the same way as with SQL?</p>
  
  <p>I wan't to construct some "startswith", "endswith" and "contains"-expressions.</p>
  
  <p>Example of what I want to achieve:</p>
  
  <pre><code>for $x in /user where $x/firstname LIKE '%xxx' return $x
  for $x in /user where $x/middlename LIKE 'xxx%' return $x 
  for $x in /user where $x/lastname LIKE '%xxx%' return $x
  </code></pre>
  
  <p>Is there any way to achieve this in XQuery?</p>
  
  <p>EDIT:</p>
  
  <p>Got the answer to the question above. New problem:</p>
  
  <p>Would there be any way to do this the opposite way around? I would like to run those queries with the sql equivalent NOT LIKE operator. Is this possible? It has to be in an FLWOR-expression</p>
  
  <p>EDIT2:</p>
  
  <p>Solved the problem. You can run fn:not(starts-with('123', '1')) and it returns false.</p>