use of large input string causes the stack overflow, when the characters to be matched are added in alternation
input = "xyxyxyxy...";
regExpression = (x|y)*;
Need to know what is the reason for the stack overflow in java? Found one related article that Java regular expression uses recursive calls to implement backtracking.
This gets resolved, when atomic group is created like
regExpression = (**?>**x|y)*