Regex for extracting 3 digits numbers between brackets

前端 未结 3 1677
攒了一身酷
攒了一身酷 2021-01-28 05:12

My string is:

Frequency/FA ID VerifiedFA0 FAID5(125)/FA1 FAID7(175)/FA2 FAID1(476)

The regex I\'m trying to create should extract these numbers

3条回答
  •  孤独总比滥情好
    2021-01-28 05:29

    Check this out:

    String s = "Frequency/FA ID VerifiedFA0 FAID5(125)/FA1 FAID7(175)/FA2 FAID1(476)";
    Pattern patt = Pattern.compile("\\(\\d+\\)");
    Matcher match = patt.matcher(s);
    while(match.find()){
        System.out.println(match.group());
    }
    

提交回复
热议问题