I have several message types that I have to parse and database from chat rooms. Some fields have a specific format, some are free form, and some fields are optional, leading to several message variations and of course there are humans typing them so mistakes are inevitable. I am hoping for some guidance on the best approach to parsing these. I am currently using regex to break these apart but because some fields are optional, it is getting cumbersome to tell which ones were included in the messages. I also want to give feedback when the field is incorrectly formatted and have some flexibility for correcting some common mistakes...
time / date / address / when / free form 1 /free form text 2 time / date / free form 1 / free form 2 time / date / when / free form 1 / what
I am not sure I can do it effectively with parseRecDescent or any of the other parsers. There seems to be a steep learning curve and of course I need to have it done yesterday... Just looking for some guidance from anyone who has tackled this type of problem... Any help appreciated

In reply to parsing question by liamlrb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.