Implement a robust parser for structured and unstructured input strings, handling edge cases, malformed data, and superfluous characters.