正则表达式 按组捕获

item=live:0:9000000028

boolean boo = item.matches("^(audio:|live:|review:|aureview:)" + "(" + "2" + ":)" + "(" + "9000000000" + ")");

boo 是 false

item=live:2:9000000000

boolean boo = item.matches("^(audio:|live:|review:|aureview:)" + "(" + "2" + ":)" + "(" + "9000000000" + ")");

boo 是 true

上一篇:邮政编码的正则表达式


下一篇:三十、正则