How to check input string must follow below sequece? : I have a String and I just want to validate this string please help me how can I did this...

my String is like "one=1&two=2" is a valid String String like `"sdassa=2&3=4" ` and `"23=2&sa=32fd"` is  also valid invalid is like `"12one=&13&=3"` is not a valid String please help me to validate this String.
