Question: Make a second C# program to demonstrate validation of a pattern with a regular expression. Create a button to act as a credit card verifier

Make a second C# program to demonstrate validation of a pattern with a regular expression.

Create a button to act as a credit card verifier and add a textbox to the form for the user to type a credit card number for validation.

The code for this button should use a Regular Expression to test the value in the textbox. The valid format and range of values is: 4 sets of 4 digits separated by dashes, the leading digit in the first group cannot be 0, the second group of digits are each in the range of 1-3 [they are control numbers indicating the type of card.]

If the credit card number is not in a valid formatgive a message box or message in a label to the user that the number entered is not a valid card number. Otherwise give a message that the credit card number is in a valid format.

Example: 1234-1122-7474-1234 is a valid card number.

222-22-222, 0111-1111-1111-1111, and b123-5555-1111-1111 are not valid card numbers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!