let parse_header_version s =
let err =
error "invalid version" (`HD, s)
<:sexp_of< header_item_tag * string >>
in
match String.lsplit2 ~on:'.' s with
| None -> err
| Some (a,b) ->
if (String.for_all a ~f:Char.is_digit)
&& (String.for_all b ~f:Char.is_digit)
then
Ok s
else
err