java validate and parse key and value of string

java validate and parse key and value of string
String input = "one=1&two=2";
Pattern p = Pattern.compile("^(?:\\w*=\\d*(?:&|$))+$");
Matcher m = p.matcher(input);
if (m.matches()) System.out.println("Matches!");
S‮ruo‬ce:www.lautturi.com
Created Time:2017-09-18 15:45:58  Author:lautturi