Java String comparison / matching using boolean query (e.g. contains("('word1' AND 'word2') OR 'word3'") )
<p>I don't really know how to exactly ask that questing but I hope the title says it already.</p>

<p>I am searching for a way (a framework / lib) which provides an ability to do a String.contains() function which tells me if a given String matches a search query. </p>

<pre><code>String1: "word1 word2 word3"
String2: "word3 word4 word5"
</code></pre>

<p>I want to ask:</p>

<pre><code>String1.contains("('word1' AND 'word2') OR 'word3'")") ==&gt; TRUE
String2.contains("('word1' AND 'word2') OR 'word3')") ==&gt; TRUE
String2.contains("('word1' AND 'word2')")") ==&gt; FALSE
</code></pre>

<p>Is there something out which does what I want?
Things like Lucene search framework come to my mind but this seems overkill to what I want to achieve.</p>

<p>Thanks for any hints. If this question is already answered then sorry, I haven't found it. </p>

<p>Thanks
Christoph</p>
