title: Apache Pig - MATCHES with multiple match criteria
body: <p>I am trying to take a logical match criteria like:</p>
  
  <pre><code>(("Foo" OR "Foo Bar" OR FooBar) AND ("test" OR "testA" OR "TestB")) OR TestZ
  </code></pre>
  
  <p>and apply this as a match against a file in pig using</p>
  
  <pre><code>result = filter inputfields by text matches (some regex expression here));
  </code></pre>
  
  <p>The problem is I have no idea how to trun the logical expression above into a regex expression for the matches method. </p>
  
  <p>I have fiddled around with various things and the closest I have come to is something like this:</p>
  
  <pre><code>((?=.*?\bFoo\b | \bFoo Bar\b))(?=.*?\bTestZ\b)
  </code></pre>
  
  <p>Any ideas? I also need to try to do this conversion programatically if possible.</p>
  
  <p>Some examples:</p>
  
  <p>a - The quick brown Foo jumped over the lazy test (This should pass as it contains foo and test)</p>
  
  <p>b - the was something going on in TestZ (This passes also as it contains testZ)</p>
  
  <p>c - the quick brown Foo jumped over the lazy dog (This should fail as it contains Foo but not test,testA or TestB)</p>
  
  <p>Thanks</p>