Define a regular expression for validating each of the following:

a. A U S zip code. The zip code must have five digits, followed by an optional hyphen and four digits.
b. A telephone number in the format (aaa) nnn-nnnn, where aaa represents the area code and the n’s represent digits.
c. A date in the form of day-month-year, where the month is a three-letter code and the year is four digits. A hyphen must separate the day and month and year and month.
d. The alphabetic derivation code illustrated in this chapter for a magazine subscriber. The format is 99999XXX9999X X X, where X represents a letter and 9 represents a number.


```
a. \d{5}[?]\d{4}
```
```
b. [(]\d{3}[)]\d{3}[?]\d{4}
```
```
c. \d{2}[-][A-Z]{3}[?]\d{4}
```
```
d. \d{5}[A?Z]{3}\d{4}[A?Z]{3}
```

Computer Science & Information Technology

You might also like to view...

Every class in Java, except ________, extends an existing class.

a. Integer. b. Object. c. String. d. Class.

Computer Science & Information Technology

In the ____________________ section, each output port contains an Ethernet transmitter and output frame buffer.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

How can the performance complexity of the following algorithm be described? for x in range(numIterations): value = value * xprint(value)

A. exponential B. logarithmic C. quadratic D. linear

Computer Science & Information Technology

What cryptographic transport algorithm is considered to be significantly more secure than SSL?

A. AES B. HTTPS C. ESSL D. TLS

Computer Science & Information Technology