let match_date = Re.Str.regexp {|[0-9]+/[0-9]+/[0-9]+|} type t = | Null | Error of string | Content of string | Integer of int | Float of float let to_string = function | Null -> "" | Error s -> s | Integer i -> string_of_int i | Float f -> string_of_float f | Content c -> ( match String.starts_with ~prefix:"0" c with | false -> c | true -> (* If the string is a date, do not escape it *) if Re.Str.string_match match_date c 0 then c else String.concat "" [ "=\""; c; "\"" ])