\d: This is a special sequence in regex that matches any digit (equivalent to [0-9]).
{3}: This is a quantifier that specifies exactly how many times the preceding element should be repeated. In this case, it means that exactly three digits should be matched.
(\d{3}): The parentheses around \d{3} create a capture group. This means that the matched sequence of three digits is stored as a group, which can be referenced later in the regex or in the code that uses the regex.
So, the entire regex (\d{3})(\d{3})(\d{3})(\d{3}) matches a string that consists of four groups of exactly three digits each.
C&E contain 4 groups of 3 digits.
The third use of backslash is for specifying generic character types. The following are always recognized:
\d any decimal digit
\D any character that is not a decimal digit
\s any whitespace character
\S any character that is not a whitespace character
\w any "word" character
\W any "non-word" character
\d{8}
matches exactly 8 digits. An opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken as a literal character.
This section is not available anymore. Please use the main Exam Page.300-820 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
iamnoone
2 months agoCollabinski
9 months, 2 weeks agoJamieF66
2 years ago