正则表达式匹配问题

String a5="^listGoods.action\\?brandId=([0-9]*)&c0=([0-9]*)&order=([0-9]*)&c2=([0-9]*)&c3=([0-9]*)&p11=(.*)&p12=(.*)&p13=(.*)&t=([0-9]*)&p14=(.*)&p16=(.*)&p17=(.*)&p18=(.*)&page=([0-9]+)&maxPage=([0-9]+)&maxRecord=([0-9]+)$";
String a51="^listGoods.action\\?brandId=([0-9]*)&c0=([0-9]*)&order=([0-9]*)&c2=([0-9]*)&c3=([0-9]*)&p11=(.*)&p12=(.*)&p13=(.*)&t=([0-9]*)&p14=(.*)&p16=(.*)&p17=(.*)&p18=(.*)&maxPage=([0-9]+)&maxRecord=([0-9]+)&page=([0-9]+)&maxPage=([0-9]+)&maxRecord=([0-9]+)$";
String s5="listGoods.action?brandId=&c0=4&order=&c2=&c3=&p11=&p12=&p13=&t=40&p14=&p16=&p17=&p18=&maxPage=12&maxRecord=269&page=1&maxPage=12&maxRecord=269";
System.out.println("======s5.matches(a5)===="+s5.matches(a5));
System.out.println("======s5.matches(a51)===="+s5.matches(a51));

 怎么样让s5只匹配a51  

先s5和a5  a51 都可以匹配

你可能感兴趣的:(正则表达式)