let match_whole (r:Str.regexp) (s:string) : result = try let a = Str.search_forward r s 0 in let y = Str.matched_string s in let b = (Str.match_end ())-1 in Some (a,y,(matched_groups 1 s),b) with Not_found -> None