Hello all,

I've got an input stream containing a comma-delimited list of all the email
addresses for a given person (in Internet-standard form, i.e.
localpart@domain). However, the process that collects these addresses
doesn't have very effective data validation and all sorts of input issues
creep through (e.g. addresses with no at-sign, addresses with embedded
blanks, addresses with characters outside the allowable set for dot-atoms,
etc.). The first address in the comma-delimited list is supposed to be the
person's preferred address, but if it is invalid, I'd like to choose the
first address in the list that is not invalid.

So, I am looking for ideas on how to choose the first VALID address on that
list rather than just the first address. As usual the selection logic is in
the middle of a huge pipeline with all sorts of things going on, so it will
be important to not disturb the timing in any way.

Is this at all practical? I'm willing to keep the selection criteria simple
(e.g. just make sure there's an at-sign and no embedded blanks and forget
about invalid characters) if that will help (as the first two are much more
frequently the problem).
--
bc

Reply via email to