Question 1
Q1Which of the following regular expressions represents a single upper-case letter?
Show answer & explanation
Correct answer: B
The character class [A-Z] correctly matches any single uppercase letter from A to Z. Character classes in regular expressions use square brackets to define a range or set of characters. The other options are incorrect: ;UPPER: is not a valid regular expression syntax, !a-z uses shell negation syntax rather than regex, %c is not valid regex syntax, and {AZ} uses curly braces which specify repetition counts, not character classes.