I understand this may be a duplicate but I have not found an answer that satisfies this question. I have a large string that is set up like so:
season
content content content content content
season
content content content content content
season
content content content content content
etc.
I want to get all of the content in between the "season" string and put that content in to a List. This is my code so far but it does not work, it does not match anything...
String pattern = "season";
Pattern pattern2 = Pattern.compile(pattern+"(.*?)"+pattern);
Matcher m = pattern2.matcher(str);
while(m.find()) {
System.out.println(m.group());
When I use StringUtils.substringBetween() it does work but I need to get every string in between two "season" strings.