Use Ctrl+F to open the Find And Replace dialog box.
Check the Regular Expression check box and the Match Case check box.
Enter the regular expression pattern
in the Search For text box.
Click the Find All button, and inspect the matches that are highlighted.
Figure A-17 shows the matches in OpenOffice.org Writer. As you can see, all of the part numbers match the
Before working through a couple of the matches, briefly look at part of the regular expression pattern,
. The asterisk applies to the character class
, which I call a
Why does the first part number
match? When the regular expression engine is at the position imme-
diately before the
, it attempts to match the next character in the part number with an uppercase
Because the first character of the part number
is an uppercase
, there is a match. Next, an attempt is
made to match an uppercase
. That too matches, as does an attempt to match an uppercase
. At that
Appendix A: Simple Regular Expressions
bapp01.qxd:bapp01 10:47 333