Of course, for the sake of ethics, we're assuming that the user has volunteered this information with upfront knowledge about its ultimate use. After all, this registration log isn't of much use if it contains invalid data.
Telephone numbers are easier to validate than e-mail addresses, so let's begin there.
Spaces and dashes should be optional but tolerated by our validator. This variable will ultimately receive a true or false value, depending on the success of the right hand operation. That right hand operation is the now-familiar conditional pattern match. So, let's begin building our real-life registration script, register.cgi , focusing first on the validation code. Please go back and try again.