Ajax software
Free javascripts
↑
Main Page
As you can see in Figure A-9, no match is found in OpenOffice.org Writer. Numeric digits in OpenOffice.org
Writer use nonstandard syntax in that OpenOffice.org Writer lacks support for the
\d
metacharacter.
One solution to this type of problem in OpenOffice.org Writer is to use character classes. For now, it is
sufficient to note that the regular expression pattern
[0-9][0-9][0-9]
gives the same results as the pattern
\d\d\d
, because the meaning of
[0-9][0-9][0-9]
is the same as
\d\d\d
. The use of that character class to match three successive numeric digits in the file
ABC123.txt
is shown in Figure A-10.
Another syntax in OpenOffice.org Writer uses POSIX metacharacters.
The
findstr
utility also lacks the
\d
metacharacter, so if you want to use it to find matches, you must
use the preceding character class shown in the command line, as follows:
findstr /N [0-9][0-9][0-9] ABC123.txt
Figure A-10
323
Appendix A: Simple Regular Expressions
bapp01.qxd:bapp01 10:47 323
Ajax software
Free javascripts
→