Sometimes, you will want there to be an unlimited number of occurrences. You can specify an unlimited
maximum number of occurrences by omitting the maximum-occurrence specifier inside the curly braces.
To specify at least two occurrences and an unlimited maximum, you could use the following problem
Match an uppercase
. If there is a match, attempt to match an uppercase
. If there is a match, attempt
to match an uppercase
. If all three uppercase characters match, attempt to match a minimum of two
occurrences and an unlimited maximum occurrence of three numeric digits.
You can express that using the following pattern:
Figure A-21 shows the appearance in OpenOffice.org Writer. Notice that now all four numeric digits in
form part of the match, because the maximum occurrences that can form part of a match are
Appendix A: Simple Regular Expressions
bapp01.qxd:bapp01 10:47 340