I have for example field with value
String a="Items:#1000#,#2000#";
for which I developed the logic to get values 1000 and 2000 successfully.
Pattern p = Pattern.compile("\\#(.*?)\\#");
Matcher m = p.matcher(a);
while(m.find()){
System.out.println(m.group(1));
}
It works OK!!!
But I have issue with some values which should not be take into account with only one # sign and after that double ## signs. For example:
String a="Items:#1 #1000#,#2000#";
This value 1 should not be taken into consideration!!!!
But my code returns in this case 1
and ,
which is not good it should return again 1000
and 2000
Is this possible somehow to ignore the value with just one #? Unfortunately I have many values with one # before the double ## signs?
Values are always separated with ##
and coma