let rec matched_groups i x : (string list) = 
 try
    let g=(Str.matched_group i x) in g::(matched_groups (i+1) x)
 with _ -> []