0

I have the following input

[a:xxxx] [b:yyy] [z:ddd]

I would like to extract using regex the values: a,b,c.

I tried using

Pattern tm = Pattern.compile("\\[(.*?):.*\\]",Pattern.CASE_INSENSITIVE | 
Pattern.UNICODE_CASE);   
Matcher m = tm.matcher(inputString);
ArrayList<String> res= new ArrayList<String>();
while (m.find()) 
     res.add(m.group(1));

However what I get is only a.

Any suggestions?

Thanks.

PKey
  • 3,715
  • 1
  • 14
  • 39

0 Answers0