Even though only one or two lines of code may be involved, those lines will effectively incorporate a small program. The first thing to start with is the smallest bits. The simplest character class is a single character, which is just included in the pattern as a literal. Frequently, we want to allow matching of a class of characters. There are also a number of named character classes that may be abbreviated, and that will be accurate for platform and national language.
Repetition is indicated by one of several operators.
The first digit character class has no repitition operator, so it simply occurs once. Overall, it amounts to either one or two digits. But once they are mastered, a great deal of expressive power is obtained.