public class instanceoftest {
public static void main(String[] args) {
String regx = "commissionamount:(\\d+)";
Matcher m = Pattern.compile(regx).matcher("||commissionamount:10098||meal_plan:Room[919075802]-早餐的收費為每人每晚JPY2,000。||commissionamount:3208||meal_plan:Room[919075803]-早餐的收費為每人每晚JPY2,000。||commissionamount:4752||meal_plan:Room[919075801]-早餐的收費為每人每晚JPY2,000。||commissionamount:2970 Total Surcharge is:18775");
while (m.find()) {
System.err.println(m.group(1));
}
}
}
java正则表达式取字符串的数据
最新推荐文章于 2024-08-05 03:37:41 发布