In Java, I have a List of strings as follows:
List<String> OriginalList = Arrays.asList(
"A=1,B=2,C=3",
"A=11,B=12,C=13,D=15",
"A=5,B=4,C=9,D=10,E=13",
"A=19,B=20,C=91,D=40,E=33",
"A=77,B=27,C=37");
I want to extract all values from this list that correspond to the "key" A
. So, for example, I want to extract:
[1,11,5,19,77]
I thought I might be able to use a regular expression for this. What regular expression would I need to write?
Or is there a better solution to extract these values from a Java List?