public static String eachMatch ( String self , String regex , @ ClosureParams ( value = FromString . class , options = { "List<String>" , "String[]" } ) Closure closure ) { return eachMatch ( self , Pattern . compile ( regex ) , closure ) ; }
Process each regex group matched substring of the given string . 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 .