OS Manuals

/usr/bin/pcre2test

perl-compatible regular expression library

From pcre2 10.49-r3 (os), captured 2026-11-05 by running pcre2test --help (exit 0). permalink

Usage:     pcre2test [options] [<input file> [<output file>]]

Input and output default to stdin and stdout.
If input is a terminal, readline() is used to read from it.

Options:
  -8            use the 8-bit library
  -16           use the 16-bit library
  -32           use the 32-bit library
  -ac           set default pattern modifier PCRE2_AUTO_CALLOUT
  -AC           as -ac, but also set subject 'callout_extra' modifier
  -b            set default pattern modifier 'fullbincode'
  -C            show PCRE2 compile-time options and exit
  -C arg        show a specific compile-time option and exit with its
                  value if numeric (else 0). The arg can be:
     backslash-C    use of \C is enabled [0, 1]
     bsr            \R type [ANYCRLF, ANY]
     ebcdic         compiled for EBCDIC character code [0, 1]
     ebcdic-io      if compiled for EBCDIC, whether pcre2test's input
                      and output is EBCDIC or ASCII [0, 1]
     ebcdic-nl25    if compiled for EBCDIC, whether NL is 0x25 [0, 1]
     jit            just-in-time compiler supported [0, 1]
     jitusable      test JIT usability [0, 1, 2, 3]
     linksize       internal link size [2, 3, 4]
     newline        newline type [CR, LF, CRLF, ANYCRLF, ANY, NUL]
     pcre2-8        8 bit library support enabled [0, 1]
     pcre2-16       16 bit library support enabled [0, 1]
     pcre2-32       32 bit library support enabled [0, 1]
     unicode        Unicode and UTF support enabled [0, 1]
  --colo[u]r[=<always,auto,never>]
                show output in colour
  -d            set default pattern modifier 'debug'
  -dfa          set default subject modifier 'dfa'
  -E            preprocess input only (#if ... #endif)
  -error <n,m,..>  show messages for error numbers, then exit
  -help         show usage information
  -i            set default pattern modifier 'info'
  -jit          set default pattern modifier 'jit'
  -jitfast      set default pattern modifier 'jitfast'
  -jitverify    set default pattern modifier 'jitverify'
  -LM           list pattern and subject modifiers, then exit
  -LP           list non-script properties, then exit
  -LS           list supported scripts, then exit
  -malloc       exercise malloc() failures
  -q            quiet: do not output PCRE2 version number at start
  -pattern <s>  set default pattern modifier fields
  -subject <s>  set default subject modifier fields
  -S <n>        set stack size to <n> mebibytes
  -t [<n>]      time compilation and execution, repeating <n> times
  -tm [<n>]     time execution (matching) only, repeating <n> times
  -T            same as -t, but show total times at the end
  -TM           same as -tm, but show total time at the end
  -unittest     run unit tests, then exit
  -v|--version  show PCRE2 version and exit
Options (31)
OptionDescriptionSource
-8If the 8-bit library has been built, this option causes it to be used (this is the default).help + man
-16If the 16-bit library has been built, this option causes it to be used.help + man
-32If the 32-bit library has been built, this option causes it to be used.help + man
-acBehave as if each pattern has the auto_callout modifier, that is, insert automatic callouts into every pattern that is compiled.help + man
-ACAs for -ac, but in addition behave as if each subject line has the callout_extra modifier, that is, show additional information from callouts.help + man
-bBehave as if each pattern has the fullbincode modifier;help + man
-COutput the version number of the PCRE2 library, and all available information about the optional features that are included, and then exit with zero exit code.help + man
--colo u]r[=<alwaysshow output in colourhelp
-dBehave as if each pattern has the debug modifier;help + man
-dfaBehave as if each subject line has the dfa modifier;help + man
-ERun in "preprocess only" mode (similar to "gcc -E").help + man
-error nshow messages for error numbers, then exithelp
-helpOutput a brief summary these options and then exit.help + man
-iBehave as if each pattern has the info modifier;help + man
-jitBehave as if each pattern line has the jit modifier;help + man
-jitfastBehave as if each pattern line has the jitfast modifier;help + man
-jitverifyBehave as if each pattern line has the jitverify modifier;help + man
-LMList modifiers: write a list of available pattern and subject modifiers to the standard output, then exit with zero exit code.help + man
-LPList properties: write a list of recognized Unicode properties to the standard output, then exit with zero exit code.help + man
-LSList scripts: write a list of recognized Unicode script names to the standard output, then exit with zero exit code.help + man
-mallocExercise malloc() failures, by first counting the number of calls made to malloc during pattern compilation and matching, then re-running the compilation and matching that many times, exercising a…help + man
-qDo not output the version number of pcre2test at the start of execution.help + man
-pattern sBehave as if each pattern line contains the given modifiers.help + man
-subject sBehave as if each subject line contains the given modifiers.help + man
-S nOn Unix-like systems, set the size of the run-time stack to size mebibytes (units of 10241024 bytes).help + man
-t nRun each compile and match many times with a timer, and output the resulting times per compile or match.help + man
-tm nThis is like -t except that it times only the matching phase, not the compile phase.help + man
-T -TMThese behave like -t and -tm, but in addition, at the end of a run, the total times for all compiles and matches are output.help + man
-TMsame as -tm, but show total time at the endhelp
-unittestRun a fixed set of additional tests of the PCRE2 API which are not driven by the test input files, and then exit.help + man
-versionOutput the PCRE2 version number and then exit. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.