7Counted repetition {n,m}
Braces give an exact count: \d{4} is four digits, a{2,} two or more a's.
Braces repeat a token a precise number of times:
{3} | exactly 3 times |
{2,5} | between 2 and 5 times |
{2,} | 2 or more times |
\d{4} is a four-digit year, [A-Z]{2}\d{3} two capital letters and three digits.
These checks require the whole line to match: RegexNex adds
^(?:…)$ around your pattern for exercises marked whole line.Exercises
Lesson complete – well done!