I have a pattern like the following
API:ADD|TYPE:ABC...MATCH:TRUE
[LOTS OF OTHER LOG LINES]
API:ADD|TYPE:ABC...MATCH:TRUE
[LOTS OF OTHER LOG LINES]
API:ADD|TYPE:DEF...MATCH:TRUE
I tried the following regex:
(API:.*MATCH:(TRUE|FALSE))
while (matcher.find()) {
System.out.println(i + " occurence");
i++;
matches.add(matcher.group());
}
It matches from first "API" to last "TRUE" and hence only one substring is returned! I want three substrings (in this scenario) starting from "API" till either "TRUE" or "FALSE".
Appreciate your help in this regard.Thanks.
Edit:
-------------------------------------------------------
20:31:57 CALL add 35
-------------------------------------------------------
20:31:57 REASON API:ADD|TYPE:ABC|ErrorType:VALIDATION|Error Message:User already has|MATCH:FALSE