let string_to_valid s = 
  let vl  = Str.split (Str.regexp ",") s in
  let reg = Str.regexp "\\([CSp]\\)\\([0-9]*\\)-\\([0-9]*\\)" in 
  let string_to_one sub = 
    if (Str.string_match reg sub 0) then begin
      let rsp  = string_to_resp (Str.matched_group 1 sub) in 
      let from = Str.matched_group 2 sub in 
      let towd = Str.matched_group 3 sub in 
(*         Printf.printf "'%s' '%s'-'%s'" (resp_to_string rsp) from towd; *)
        match (from,towd) with 
          | ("",""-> []
          | ("",s)  -> [(rsp,Inferior (int_of_string s))]
          | (t,"")  -> [(rsp,Superior (int_of_string t))]
          | _       -> [(rsp,Between ((int_of_string from),(int_of_string towd)))]
    end else []
  in List.concat (List.map string_to_one vl)