📅  最后修改于: 2022-03-11 14:52:39.607000             🧑  作者: Mango
String input = "one=1&two=2";
Pattern p = Pattern.compile("^(?:\\w*=\\d*(?:&|$))+$");
Matcher m = p.matcher(input);
if (m.matches()) System.out.println("Matches!");