I have a string of the following format:
String name = "A|DescA+B|DescB+C|DescC+...X|DescX+"
So the repeating pattern is ?|?+, and I don't know how many there will be. The part I want to extract is the part before |...so for my example I want to extract a list (an ArrayList for example) that will contain:
[A, B, C, ... X]
I have tried the following pattern:
(.+)\\|.*\\+
but that doesn't work the way I want it to? Any suggestions?