June 2017
Beginner
1296 pages
69h 23m
English
| ... Matches one or more occurrences of the pattern. | |
? |
Matches zero or one occurrences of the pattern. |
{n} |
Matches exactly n occurrences. |
{n,} |
Matches at least n occurrences. |
{n,m} |
Matches between n and m (inclusive) occurrences. |
Quantifiers used in regular expressions.
All of the quantifiers are greedy. This means that they’ll match as many occurrences as they can as long as the match is still successful. However, if any of these quantifiers is followed by a question mark (?), the quantifier becomes reluctant (sometimes called lazy). It then will match as few occurrences as possible as long as the match is still successful.
The zip code (line 33 in Fig. 14.20) matches a digit five times. This regular expression uses the digit character class ...