I am trying to learn some regular expressions to validate different inputs. Can someone help me out with these?

Provide a perl regular expression that can be used to validate each of the following pattern descriptions: • a 3 digit area code • a 3 digit area code that must be enclosed in parenthesis • a 3 digit area code that may be enclosed in parenthesis • a 9 digit social security number • a 9 digit social security number that must include dashes after the 3rd and 5th digit • a 9 digit social security number that might include dashes after the 3rd and 5th digit

This is exactly the reason for preferring a module. Someone else is responsible for these details (and keeping them up-to-date.)

Yeah, true in general, except that the world is vast and that the module you are talking about is only for US areas code, and the OP has not specified if he or she was talking about US area codes or those from another country