1. Define a regular expression for validating each of the following: a. A U.S. zip code, which...

90.2K

Verified Solution

Question

Operations Management

1. Define a regular expression for validating each ofthe following:

a. A U.S. zip code, which 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 ns represent digits.

c. A date in the form of day-month-year, where themonth is a three-letter code and the year is four digits. A hyphenmust separate the day and month and year and month.

2. For the following codes, define the validationcriteria (there may be multiple checks for each field) and theorder in which you would test each of the conditions.

a. A credit card number entered on a Web form: Thecustomer has selected the type of credit card from a drop-downlist.

b. A part number in a hardware store: The part numberis a complex code, where the first digit represents the department(such as housewares, automotive, and so on), and the number shouldbe self-checking. There are seven different departments.

c. The date that a book was postmarked when returnedto an online bookstore: A copy of the customer receipt must beincluded with the book. Returned books must be postmarked within 30days of the purchase date.

d. A language spoken code used on a website: Hint:Search the Web for standard language codes.

e. The Canadian postal code: The format is X9X 9X9 (Xis any letter, 9 is any number).

f. Airport codes: Such as LAX for Los Angeles or DUBfor Dublin.

Answer & Explanation Solved by verified expert
3.9 Ratings (354 Votes)
Please pleaseplease LIKE THIS ANSWER so that I can get a small benefitPleaseDefine a regular expression for validating each of thefollowinga A US zip code which must have five digitsfollowed by an optional hyphen and four digitsb A telephone number in the format aaa nnnnnnn where aaarepresents the area code and the ns representdigitsc A date in the form of daymonthyear where the month is athreeletter code and the year is four digits A hyphen mustseparate the day and month and year and monthaRegular Expression for US zip code which has 5 digits followed byan optional hyphen and 4 digits is as follows bExpression for a telephone    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students