}
public void testAddImplicitResolver2() {
Yaml yaml = new Yaml(new PointRepresenter());
Pattern regexp = Pattern.compile("\\d\\d-\\d\\d-\\d\\d\\d");
yaml.addImplicitResolver(new Tag(Tag.PREFIX + "Phone"), regexp, "\0");
Pattern regexp2 = Pattern.compile("x\\d_y\\d");
// try any scalar, and not only those which start with 'x'
yaml.addImplicitResolver(new Tag(Tag.PREFIX + "Point"), regexp2, null);
Map<String, Object> map = new LinkedHashMap<String, Object>();
map.put("a", new Phone("12-34-567"));
map.put("b", new Point(1, 5));
String output = yaml.dump(map);
assertEquals("{a: 12-34-567, b: x1_y5}\n", output);