Fix for message parsing bug

Correctly implemented the BNF in RFC 1459 with regexes.