Flexible text parsing strategies

c# – Flexible text parsing strategies – Stack Overflow

Problem

I’m trying to find a flexible way to parse email content. Below is an example of dummy email text I’m working with. I’d also like to avoid regular expressions if at all possible. However, at this point of my problem solving process I’m beginning to think it’s inevitable. Note that this is only a small dummy subset of a full email. What I need is to parse every field (e.g. Ticket No, Cell Phone) into their respective data types. Lastly, some fields are not guaranteed to be present in the email (you’ll see in my current solution shown below why this is a problem).

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 4 + 5 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)