<p dir="ltr">Yup, the only way would be to parse a possible list of alternatives. Should be simple with parsing libraries like parsec.</p>
<p dir="ltr">    try format1 <|> try format2 <|> ...</p>
<p dir="ltr">Regards,<br>
  Sumit</p>