Which string would match the pattern b[a-c]d?

Study for the Computer Proficiency Test. Explore flashcards and multiple-choice questions, each with hints and explanations. Prepare yourself for success!

Multiple Choice

Which string would match the pattern b[a-c]d?

Explanation:
A character class with a range, like [a-c], means any one character from a to c, inclusive. So the pattern b[a-c]d requires three characters: a leading b, then a middle character that is either a, b, or c, and a trailing d. Among the given strings, bad has a in the middle, which fits the allowed set, while bud, bid, and bed have middle characters outside that range (u, i, e respectively). Therefore, bad is the one that matches.

A character class with a range, like [a-c], means any one character from a to c, inclusive. So the pattern b[a-c]d requires three characters: a leading b, then a middle character that is either a, b, or c, and a trailing d. Among the given strings, bad has a in the middle, which fits the allowed set, while bud, bid, and bed have middle characters outside that range (u, i, e respectively). Therefore, bad is the one that matches.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy