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