/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
class Ideone
{
{
String s
= "stxt:usa,city:14"; Pattern pattern = Pattern.compile("(stxt|city):([^,]+)");
Matcher matcher = pattern.matcher(s);
while (matcher.find()){
System.
out.
println(matcher.
group(1)); System.
out.
println(matcher.
group(2)); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwucmVnZXguKjsKY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCQoJCVN0cmluZyBzID0gInN0eHQ6dXNhLGNpdHk6MTQiOwoJCVBhdHRlcm4gcGF0dGVybiA9IFBhdHRlcm4uY29tcGlsZSgiKHN0eHR8Y2l0eSk6KFteLF0rKSIpOwoJCU1hdGNoZXIgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcihzKTsKCQl3aGlsZSAobWF0Y2hlci5maW5kKCkpewoJCQlTeXN0ZW0ub3V0LnByaW50bG4obWF0Y2hlci5ncm91cCgxKSk7CgkJCVN5c3RlbS5vdXQucHJpbnRsbihtYXRjaGVyLmdyb3VwKDIpKTsKCQl9IAoJfQp9