code: public static <T extends CharSequence> T eachMatch(T self, Pattern pattern, @ClosureParams(value=FromString.class, options={"List<String>","String[]"}) Closure closure) {
          eachMatch(self.toString(), pattern, closure);
          return self;
      }
docs: Process each regex group matched substring of the given pattern. If the closure
  parameter takes one argument, an array with all match groups is passed to it.
  If the closure takes as many arguments as there are match groups, then each
  parameter will be one match group.
  
  @param self    the source CharSequence
  @param pattern a regex Pattern
  @param closure a closure with one parameter or as much parameters as groups
  @return the source CharSequence
  @see #eachMatch(String, java.util.regex.Pattern, groovy.lang.Closure)
  @since 1.8.2