When working with data, particularly user-submitted data, you often need to validate it. For example, if we are creating a database in which there is a “site” field and corresponding IP address field, it would be very useful to ensure that the data written to these fields is in the appropriate format.