-8
If the 8-bit library has been built, this option causes it
to be used (this is the default). If the 8-bit library has
not been built, this option causes an error.
-16
If the 16-bit library has been built, this option causes
it to be used. If only the 16-bit library has been built,
this is the default. If the 16-bit library has not been
built, this option causes an error.
-32
If the 32-bit library has been built, this option causes
it to be used. If only the 32-bit library has been built,
this is the default. If the 32-bit library has not been
built, this option causes an error.
-b
Behave as if each pattern has the /B
(show byte code)
modifier; the internal form is output after compilation.
-C
Output the version number of the PCRE library, and all
available information about the optional features that are
included, and then exit with zero exit code. All other
options are ignored.
-C
option
Output information about a specific build-time option,
then exit. This functionality is intended for use in
scripts such as RunTest
. The following options output the
value and set the exit code as indicated:
ebcdic-nl the code for LF (= NL) in an EBCDIC
environment:
0x15 or 0x25
0 if used in an ASCII environment
exit code is always 0
linksize the configured internal link size (2, 3, or
4)
exit code is set to the link size
newline the default newline setting:
CR, LF, CRLF, ANYCRLF, or ANY
exit code is always 0
bsr the default setting for what \R matches:
ANYCRLF or ANY
exit code is always 0
The following options output 1 for true or 0 for false,
and set the exit code to the same value:
ebcdic compiled for an EBCDIC environment
jit just-in-time support is available
pcre16 the 16-bit library was built
pcre32 the 32-bit library was built
pcre8 the 8-bit library was built
ucp Unicode property support is available
utf UTF-8 and/or UTF-16 and/or UTF-32 support
is available
If an unknown option is given, an error message is output;
the exit code is 0.
-d
Behave as if each pattern has the /D
(debug) modifier; the
internal form and information about the compiled pattern
is output after compilation; -d
is equivalent to -b -i
.
-dfa
Behave as if each data line contains the \D escape
sequence; this causes the alternative matching function,
pcre[16|32]_dfa_exec()
, to be used instead of the standard
pcre[16|32]_exec()
function (more detail is given below).
-help
Output a brief summary these options and then exit.
-i
Behave as if each pattern has the /I
modifier; information
about the compiled pattern is given after compilation.
-M
Behave as if each data line contains the \M escape
sequence; this causes PCRE to discover the minimum
MATCH_LIMIT and MATCH_LIMIT_RECURSION settings by calling
pcre[16|32]_exec()
repeatedly with different limits.
-m
Output the size of each compiled pattern after it has been
compiled. This is equivalent to adding /M
to each regular
expression. The size is given in bytes for both libraries.
-O
Behave as if each pattern has the /O
modifier, that is
disable auto-possessification for all patterns.
-o
osize
Set the number of elements in the output vector that is
used when calling pcre[16|32]_exec()
or
pcre[16|32]_dfa_exec()
to be osize. The default value is
45, which is enough for 14 capturing subexpressions for
pcre[16|32]_exec()
or 22 different matches for
pcre[16|32]_dfa_exec()
. The vector size can be changed
for individual matching calls by including \O in the data
line (see below).
-p
Behave as if each pattern has the /P
modifier; the POSIX
wrapper API is used to call PCRE. None of the other
options has any effect when -p
is set. This option can be
used only with the 8-bit library.
-q
Do not output the version number of pcretest
at the start
of execution.
-S
size
On Unix-like systems, set the size of the run-time stack
to size megabytes.
-s
or -s+
Behave as if each pattern has the /S
modifier; in other
words, force each pattern to be studied. If -s+
is used,
all the JIT compile options are passed to
pcre[16|32]_study()
, causing just-in-time optimization to
be set up if it is available, for both full and partial
matching. Specific JIT compile options can be selected by
following -s+
with a digit in the range 1 to 7, which
selects the JIT compile modes as follows:
1 normal match only
2 soft partial match only
3 normal match and soft partial match
4 hard partial match only
6 soft and hard partial match
7 all three modes (default)
If -s++
is used instead of -s+
(with or without a
following digit), the text "(JIT)" is added to the first
output line after a match or no match when JIT-compiled
code was actually used.
Note that there are pattern options that can override -s
,
either specifying no studying at all, or suppressing JIT
compilation.
If the /I
or /D
option is present on a pattern (requesting
output about the compiled pattern), information about the
result of studying is not included when studying is caused
only by -s
and neither -i
nor -d
is present on the command
line. This behaviour means that the output from tests that
are run with and without -s
should be identical, except
when options that output information about the actual
running of a match are set.
The -M
, -t
, and -tm
options, which give information about
resources used, are likely to produce different output
with and without -s
. Output may also differ if the /C
option is present on an individual pattern. This uses
callouts to trace the the matching process, and this may
be different between studied and non-studied patterns. If
the pattern contains (*MARK) items there may also be
differences, for the same reason. The -s
command line
option can be overridden for specific patterns that should
never be studied (see the /S
pattern modifier below).
-t
Run each compile, study, and match many times with a
timer, and output the resulting times per compile, study,
or match (in milliseconds). Do not set -m
with -t
, because
you will then get the size output a zillion times, and the
timing will be distorted. You can control the number of
iterations that are used for timing by following -t
with a
number (as a separate item on the command line). For
example, "-t 1000" iterates 1000 times. The default is to
iterate 500000 times.
-tm
This is like -t
except that it times only the matching
phase, not the compile or study phases.
-T -TM
These behave like -t
and -tm
, but in addition, at the end
of a run, the total times for all compiles, studies, and
matches are output.