public static Matches matches(String regex) {
    return matches(regex, 0);
  }
@Test
  @Category(NeedsRunner.class)
  public void testMatchesGroup() {

    PCollection<String> output =
        p.apply(Create.of("a", "x xxx", "x yyy", "x zzz")).apply(Regex.matches("x ([xyz]*)", 1));

    PAssert.that(output).containsInAnyOrder("xxx", "yyy", "zzz");
    p.run();
  }