Microsoft Certified Solutions Developer (MCSD) Practice Test 2025 – Complete Exam Prep

Question: 1 / 400

Which Regular Expression pattern correctly matches a 7-digit phone number?

^\d{7}$

^[2-9][0-9]{2}-\d{4}$

The most suitable choice for matching a 7-digit phone number is based on the pattern represented. In this case, the correct answer focuses specifically on the requirements for a standard 7-digit number format, which can be simplified for practical uses.

The established pattern ensures that it begins with any digit from 2 to 9 for the first digit, given that phone numbers typically do not start with 0 or 1. It then includes any digit from 0 to 9 for the next two digits, followed by a hyphen, and concludes with another set of four digits. This structure accurately represents a common format for a 7-digit phone number, typically broken into two segments.

Other options don't meet the criteria for a standard 7-digit phone number format. For example, some options either expect additional formatting such as hyphens or are structured too loosely to pinpoint a 7-digit sequence. The chosen pattern is the most precise representation reflecting the organization and restrictions commonly found in telephone numbering conventions.

Get further explanation with Examzify DeepDiveBeta

^[0-9]{3}-\d{4}$

^\d{3}-\d{4}|\d{7}$

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy