I need to get some specific text out of a string and get that into an arraylist, but I have no idea where to start.
The string looks like this:
String exampleString = "some text I don't know <pre>the text I want to get</pre><pre>Some more text I want to get</pre> some text I don't know"
But the problem is that I don’t know how many text sections there are with <pre> text </pre> it’s even possible that there aren’t any of those sections at all.
So could anyone tell me how to get the texts between those <pre> and </pre> and how to get those into an arraylist.
Thank you so much!
UPDATE: What I do know about the text from which I said “some text I don’t know” is that it doesn’t contain <pre> or </pre>
edited: corrected regex syntax