title: How can I perform a partial match with java.util.regex.*?
body: <p>I have been using the java.util.regex.* classes for Regular Expression in Java and all good so far. But today I have a different requirement. For example consider the pattern to be "aabb". Now if the input String is aa it will definitely not match, however there is still possibility that if I append bb it becomes aabb and it matches. However if I would have started with cc, no matter what I append it will never match.</p>
  
  <p>I have explored the Pattern and Matcher class but didn't find any way of achieving this.</p>
  
  <p>The input will come from user and system have to wait till pattern matches or it will never match irrespective of any input further.</p>
  
  <p>Any clue?</p>
  
  <p>Thanks.</p>