java.util.regex.* Recursive matching

Posted by amit.bhayani on Stack Overflow See other posts from Stack Overflow or by amit.bhayani
Published on 2010-03-18T11:01:20Z Indexed on 2010/03/18 11:31 UTC
Read the original article Hit count: 372

Filed under:
|

Hi Guys,

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.

I have explored the Pattern and Matcher class but didn't find any way of achieving this.

The input will come from user and system have to wait till pattern matches or it will never match irrespective of any input further.

Any clue?

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about regex