let handle_generic key funct (cgi:Netcgi1_compat.Netcgi_types.cgi_activation) =
let regexp = Str.regexp (key^"_team_\\([0-9]*\\)_proj_\\([0-9\\.]*\\)_grp_\\([0-9]*\\)") in
let log = get_html_arg cgi "addstudent" in
let rec handle_generic_action (s,_) =
if (Str.string_match regexp s 0) then begin
let (s1,s2,s3) = (Str.matched_group 1 s,
Str.matched_group 2 s,
Str.matched_group 3 s) in
let teamnum = int_of_string s1 in
let padd = pa_of_string s2 in
let groupnum = int_of_string s3 in
funct log teamnum padd groupnum;
end in List.iter handle_generic_action (cgi # arguments)