[C]ORRECT: [C]onformance
Many data elements must conform to a specific format. For example, an email address generally follows the form:
name@somedomain
(Where somedomain might be pragprog.com.) The name and domain portions of the address each follow a different set of fairly detailed rules. You can find many of them laid out at Wikipedia.[28] Imagine that you want to validate the conformance of an email address to the many rules. (You really don’t want to, however. This is a case where you’re much better off leaning on the efforts of others. See the complete spec.[29])
Perhaps your code parses an email address, attempting to extract its name portion—the part leading up to the @ sign. But you want to worry about what to do if there is no @
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access