QuestionQ11

VerifiedSpecialized Applications of Data Science

A data scientist must accurately identify a credit card number that has 15 digits and begins with either 34 or 37. Which of the following regular expressions should the data scientist use to accomplish this?

Explanation

The expression anchors the entire value, requires 3 as the first digit and either 4 or 7 as the second digit, then permits exactly 13 more digits. This produces a total length of 15 digits and allows only prefixes 34 and 37.

Community Discussion

No comments yet. Be the first to start the discussion!