Browse Source

pcre-8.35

pull/22/head
Sergei Golubchik 12 years ago
parent
commit
2a5905141a
  1. 6
      pcre/AUTHORS
  2. 120
      pcre/ChangeLog
  3. 4
      pcre/INSTALL
  4. 6
      pcre/LICENCE
  5. 11
      pcre/NEWS
  6. 21
      pcre/README
  7. 818
      pcre/RunGrepTest
  8. 42
      pcre/RunTest
  9. 32
      pcre/configure.ac
  10. 21
      pcre/doc/html/README.txt
  11. 15
      pcre/doc/html/pcre.html
  12. 114
      pcre/doc/html/pcreapi.html
  13. 8
      pcre/doc/html/pcregrep.html
  14. 25
      pcre/doc/html/pcrepattern.html
  15. 79
      pcre/doc/html/pcresyntax.html
  16. 21
      pcre/doc/html/pcretest.html
  17. 17
      pcre/doc/pcre.3
  18. 1323
      pcre/doc/pcre.txt
  19. 104
      pcre/doc/pcreapi.3
  20. 12
      pcre/doc/pcregrep.1
  21. 709
      pcre/doc/pcregrep.txt
  22. 27
      pcre/doc/pcrepattern.3
  23. 60
      pcre/doc/pcresyntax.3
  24. 24
      pcre/doc/pcretest.1
  25. 375
      pcre/doc/pcretest.txt
  26. 57
      pcre/maria-patches/pcre_stack_guard.diff
  27. 6
      pcre/pcre.h.in
  28. 6
      pcre/pcre_byte_order.c
  29. 151
      pcre/pcre_compile.c
  30. 69
      pcre/pcre_dfa_exec.c
  31. 102
      pcre/pcre_exec.c
  32. 2
      pcre/pcre_globals.c
  33. 118
      pcre/pcre_internal.h
  34. 1931
      pcre/pcre_jit_compile.c
  35. 72
      pcre/pcre_jit_test.c
  36. 15
      pcre/pcre_printint.c
  37. 8
      pcre/pcre_string_utils.c
  38. 62
      pcre/pcre_study.c
  39. 5
      pcre/pcre_xclass.c
  40. 4
      pcre/pcregrep.c
  41. 6
      pcre/pcreposix.c
  42. 92
      pcre/pcretest.c
  43. BIN
      pcre/testdata/saved16BE-1
  44. BIN
      pcre/testdata/saved16LE-1
  45. BIN
      pcre/testdata/saved32BE-1
  46. BIN
      pcre/testdata/saved32LE-1
  47. 2
      pcre/testdata/testinput18
  48. 17
      pcre/testdata/testinput2
  49. 2
      pcre/testdata/testinput25
  50. 11
      pcre/testdata/testinput3
  51. 6
      pcre/testdata/testinput4
  52. 2
      pcre/testdata/testinput5
  53. 9
      pcre/testdata/testinput6
  54. 6
      pcre/testdata/testinput7
  55. 8
      pcre/testdata/testoutput12
  56. 2
      pcre/testdata/testoutput13
  57. 12
      pcre/testdata/testoutput14
  58. 36
      pcre/testdata/testoutput15
  59. 8
      pcre/testdata/testoutput16
  60. 28
      pcre/testdata/testoutput17
  61. 42
      pcre/testdata/testoutput18-16
  62. 42
      pcre/testdata/testoutput18-32
  63. 2
      pcre/testdata/testoutput19
  64. 192
      pcre/testdata/testoutput2
  65. 4
      pcre/testdata/testoutput21-16
  66. 4
      pcre/testdata/testoutput21-32
  67. 4
      pcre/testdata/testoutput22-16
  68. 4
      pcre/testdata/testoutput22-32
  69. 34
      pcre/testdata/testoutput23
  70. 36
      pcre/testdata/testoutput25
  71. 15
      pcre/testdata/testoutput3
  72. 174
      pcre/testdata/testoutput3A
  73. 174
      pcre/testdata/testoutput3B
  74. 8
      pcre/testdata/testoutput4
  75. 33
      pcre/testdata/testoutput5
  76. 12
      pcre/testdata/testoutput6
  77. 28
      pcre/testdata/testoutput7
  78. 2
      pcre/testdata/testoutput8
  79. 4
      pcre/testdata/wintestoutput3

6
pcre/AUTHORS

@ -8,7 +8,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
All rights reserved
@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2010-2013 Zoltan Herczeg
Copyright(c) 2010-2014 Zoltan Herczeg
All rights reserved.
@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2009-2013 Zoltan Herczeg
Copyright(c) 2009-2014 Zoltan Herczeg
All rights reserved.

120
pcre/ChangeLog

@ -1,6 +1,126 @@
ChangeLog for PCRE
------------------
Version 8.35 04-April-2014
--------------------------
1. A new flag is set, when property checks are present in an XCLASS.
When this flag is not set, PCRE can perform certain optimizations
such as studying these XCLASS-es.
2. The auto-possessification of character sets were improved: a normal
and an extended character set can be compared now. Furthermore
the JIT compiler optimizes more character set checks.
3. Got rid of some compiler warnings for potentially uninitialized variables
that show up only when compiled with -O2.
4. A pattern such as (?=ab\K) that uses \K in an assertion can set the start
of a match later then the end of the match. The pcretest program was not
handling the case sensibly - it was outputting from the start to the next
binary zero. It now reports this situation in a message, and outputs the
text from the end to the start.
5. Fast forward search is improved in JIT. Instead of the first three
characters, any three characters with fixed position can be searched.
Search order: first, last, middle.
6. Improve character range checks in JIT. Characters are read by an inprecise
function now, which returns with an unknown value if the character code is
above a certain treshold (e.g: 256). The only limitation is that the value
must be bigger than the treshold as well. This function is useful, when
the characters above the treshold are handled in the same way.
7. The macros whose names start with RAWUCHAR are placeholders for a future
mode in which only the bottom 21 bits of 32-bit data items are used. To
make this more memorable for those maintaining the code, the names have
been changed to start with UCHAR21, and an extensive comment has been added
to their definition.
8. Add missing (new) files sljitNativeTILEGX.c and sljitNativeTILEGX-encoder.c
to the export list in Makefile.am (they were accidentally omitted from the
8.34 tarball).
9. The informational output from pcretest used the phrase "starting byte set"
which is inappropriate for the 16-bit and 32-bit libraries. As the output
for "first char" and "need char" really means "non-UTF-char", I've changed
"byte" to "char", and slightly reworded the output. The documentation about
these values has also been (I hope) clarified.
10. Another JIT related optimization: use table jumps for selecting the correct
backtracking path, when more than four alternatives are present inside a
bracket.
11. Empty match is not possible, when the minimum length is greater than zero,
and there is no \K in the pattern. JIT should avoid empty match checks in
such cases.
12. In a caseless character class with UCP support, when a character with more
than one alternative case was not the first character of a range, not all
the alternative cases were added to the class. For example, s and \x{17f}
are both alternative cases for S: the class [RST] was handled correctly,
but [R-T] was not.
13. The configure.ac file always checked for pthread support when JIT was
enabled. This is not used in Windows, so I have put this test inside a
check for the presence of windows.h (which was already tested for).
14. Improve pattern prefix search by a simplified Boyer-Moore algorithm in JIT.
The algorithm provides a way to skip certain starting offsets, and usually
faster than linear prefix searches.
15. Change 13 for 8.20 updated RunTest to check for the 'fr' locale as well
as for 'fr_FR' and 'french'. For some reason, however, it then used the
Windows-specific input and output files, which have 'french' screwed in.
So this could never have worked. One of the problems with locales is that
they aren't always the same. I have now updated RunTest so that it checks
the output of the locale test (test 3) against three different output
files, and it allows the test to pass if any one of them matches. With luck
this should make the test pass on some versions of Solaris where it was
failing. Because of the uncertainty, the script did not used to stop if
test 3 failed; it now does. If further versions of a French locale ever
come to light, they can now easily be added.
16. If --with-pcregrep-bufsize was given a non-integer value such as "50K",
there was a message during ./configure, but it did not stop. This now
provokes an error. The invalid example in README has been corrected.
If a value less than the minimum is given, the minimum value has always
been used, but now a warning is given.
17. If --enable-bsr-anycrlf was set, the special 16/32-bit test failed. This
was a bug in the test system, which is now fixed. Also, the list of various
configurations that are tested for each release did not have one with both
16/32 bits and --enable-bar-anycrlf. It now does.
18. pcretest was missing "-C bsr" for displaying the \R default setting.
19. Little endian PowerPC systems are supported now by the JIT compiler.
20. The fast forward newline mechanism could enter to an infinite loop on
certain invalid UTF-8 input. Although we don't support these cases
this issue can be fixed by a performance optimization.
21. Change 33 of 8.34 is not sufficient to ensure stack safety because it does
not take account if existing stack usage. There is now a new global
variable called pcre_stack_guard that can be set to point to an external
function to check stack availability. It is called at the start of
processing every parenthesized group.
22. A typo in the code meant that in ungreedy mode the max/min qualifier
behaved like a min-possessive qualifier, and, for example, /a{1,3}b/U did
not match "ab".
23. When UTF was disabled, the JIT program reported some incorrect compile
errors. These messages are silenced now.
24. Experimental support for ARM-64 and MIPS-64 has been added to the JIT
compiler.
25. Change all the temporary files used in RunGrepTest to be different to those
used by RunTest so that the tests can be run simultaneously, for example by
"make -j check".
Version 8.34 15-December-2013
-----------------------------

4
pcre/INSTALL

@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
Briefly, the shell command `./configure && make && make install'
should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented

6
pcre/LICENCE

@ -24,7 +24,7 @@ Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
All rights reserved.
@ -35,7 +35,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2010-2013 Zoltan Herczeg
Copyright(c) 2010-2014 Zoltan Herczeg
All rights reserved.
@ -46,7 +46,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2009-2013 Zoltan Herczeg
Copyright(c) 2009-2014 Zoltan Herczeg
All rights reserved.

11
pcre/NEWS

@ -1,6 +1,17 @@
News about PCRE releases
------------------------
Release 8.35 04-April-2014
--------------------------
There have been performance improvements for classes containing non-ASCII
characters and the "auto-possessification" feature has been extended. Other
minor improvements have been implemented and bugs fixed. There is a new callout
feature to enable applications to do detailed stack checks at compile time, to
avoid running out of stack for deeply nested parentheses. The JIT compiler has
been extended with experimental support for ARM-64, MIPS-64, and PPC-LE.
Release 8.34 15-December-2013
-----------------------------

21
pcre/README

@ -85,11 +85,12 @@ documentation is supplied in two other forms:
1. There are files called doc/pcre.txt, doc/pcregrep.txt, and
doc/pcretest.txt in the source distribution. The first of these is a
concatenation of the text forms of all the section 3 man pages except
those that summarize individual functions. The other two are the text
forms of the section 1 man pages for the pcregrep and pcretest commands.
These text forms are provided for ease of scanning with text editors or
similar tools. They are installed in <prefix>/share/doc/pcre, where
<prefix> is the installation prefix (defaulting to /usr/local).
the listing of pcredemo.c and those that summarize individual functions.
The other two are the text forms of the section 1 man pages for the
pcregrep and pcretest commands. These text forms are provided for ease of
scanning with text editors or similar tools. They are installed in
<prefix>/share/doc/pcre, where <prefix> is the installation prefix
(defaulting to /usr/local).
2. A set of files containing all the documentation in HTML form, hyperlinked
in various ways, and rooted in a file called index.html, is distributed in
@ -372,12 +373,12 @@ library. They are also documented in the pcrebuild man page.
Of course, the relevant libraries must be installed on your system.
. The default size of internal buffer used by pcregrep can be set by, for
example:
. The default size (in bytes) of the internal buffer used by pcregrep can be
set by, for example:
--with-pcregrep-bufsize=50K
--with-pcregrep-bufsize=51200
The default value is 20K.
The value must be a plain integer. The default is 20480.
. It is possible to compile pcretest so that it links with the libreadline
or libedit libraries, by specifying, respectively,
@ -987,4 +988,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
Last updated: 05 November 2013
Last updated: 17 January 2014

818
pcre/RunGrepTest

@ -69,447 +69,447 @@ utf8=$?
echo "Testing pcregrep main features"
echo "---------------------------- Test 1 ------------------------------" >testtry
(cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 2 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep '^PATTERN' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 3 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 4 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -ic PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 5 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 6 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -inh PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 7 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -il PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 8 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -l PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 9 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -q PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 10 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -q NEVER-PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 11 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -vn pattern ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 12 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -ix pattern ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 13 -----------------------------" >>testtry
echo seventeen >testtemp1
(cd $srcdir; $valgrind $pcregrep -f./testdata/greplist -f $builddir/testtemp1 ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 14 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -w pat ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 15 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep 'abc^*' ./testdata/grepinput) 2>>testtry >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 16 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep abc ./testdata/grepinput ./testdata/nonexistfile) 2>>testtry >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 17 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -M 'the\noutput' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 18 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -Mn '(the\noutput|dog\.\n--)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 19 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -Mix 'Pattern' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 20 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -Mixn 'complete pair\nof lines' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 21 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -nA3 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 22 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -nB3 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 23 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -C3 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 24 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -A9 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 25 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -nB9 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 26 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -A9 -B9 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 27 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -A10 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 28 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -nB10 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 29 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -C12 -B10 'four' ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 30 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -inB3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 31 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -inA3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 32 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -L 'fox' ./testdata/grepinput ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 33 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep 'fox' ./testdata/grepnonexist) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 34 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -s 'fox' ./testdata/grepnonexist) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 35 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --include grepinput8 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 36 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 'grepinput$' --exclude=grepinput8 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 37 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep '^(a+)*\d' ./testdata/grepinput) >>testtry 2>teststderr
echo "RC=$?" >>testtry
echo "======== STDERR ========" >>testtry
cat teststderr >>testtry
echo "---------------------------- Test 1 ------------------------------" >testtrygrep
(cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 2 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep '^PATTERN' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 3 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 4 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -ic PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 5 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 6 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -inh PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 7 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -il PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 8 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -l PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 9 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -q PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 10 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -q NEVER-PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 11 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -vn pattern ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 12 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -ix pattern ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 13 -----------------------------" >>testtrygrep
echo seventeen >testtemp1grep
(cd $srcdir; $valgrind $pcregrep -f./testdata/greplist -f $builddir/testtemp1grep ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 14 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -w pat ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 15 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep 'abc^*' ./testdata/grepinput) 2>>testtrygrep >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 16 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep abc ./testdata/grepinput ./testdata/nonexistfile) 2>>testtrygrep >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 17 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -M 'the\noutput' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 18 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Mn '(the\noutput|dog\.\n--)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 19 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Mix 'Pattern' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 20 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Mixn 'complete pair\nof lines' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 21 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -nA3 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 22 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -nB3 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 23 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -C3 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 24 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -A9 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 25 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -nB9 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 26 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -A9 -B9 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 27 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -A10 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 28 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -nB10 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 29 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -C12 -B10 'four' ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 30 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -inB3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 31 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -inA3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 32 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -L 'fox' ./testdata/grepinput ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 33 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep 'fox' ./testdata/grepnonexist) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 34 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -s 'fox' ./testdata/grepnonexist) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 35 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --include grepinput8 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 36 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 'grepinput$' --exclude=grepinput8 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 37 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep '^(a+)*\d' ./testdata/grepinput) >>testtrygrep 2>teststderrgrep
echo "RC=$?" >>testtrygrep
echo "======== STDERR ========" >>testtrygrep
cat teststderrgrep >>testtrygrep
echo "---------------------------- Test 38 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep '>\x00<' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 38 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep '>\x00<' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 39 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -A1 'before the binary zero' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 39 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -A1 'before the binary zero' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 40 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -B1 'after the binary zero' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 40 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -B1 'after the binary zero' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 41 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -B1 -o '\w+ the binary zero' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 41 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -B1 -o '\w+ the binary zero' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 42 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -B1 -onH '\w+ the binary zero' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 42 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -B1 -onH '\w+ the binary zero' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 43 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -on 'before|zero|after' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 43 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -on 'before|zero|after' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 44 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -on -e before -ezero -e after ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 44 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -on -e before -ezero -e after ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 45 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -on -f ./testdata/greplist -e binary ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 45 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -on -f ./testdata/greplist -e binary ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 46 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -eabc -e '(unclosed' ./testdata/grepinput) 2>>testtry >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 46 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -eabc -e '(unclosed' ./testdata/grepinput) 2>>testtrygrep >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 47 ------------------------------" >>testtry
echo "---------------------------- Test 47 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Fx "AB.VE
elephant" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
elephant" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 48 ------------------------------" >>testtry
echo "---------------------------- Test 48 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -F "AB.VE
elephant" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
elephant" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 49 ------------------------------" >>testtry
echo "---------------------------- Test 49 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -F -e DATA -e "AB.VE
elephant" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
elephant" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 50 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 50 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 51 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 51 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 52 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --colour=always jumps ./testdata/grepinputv) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 52 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --colour=always jumps ./testdata/grepinputv) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 53 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 53 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 54 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 54 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 55 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -f./testdata/greplist --color=always ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 55 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -f./testdata/greplist --color=always ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 56 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -c lazy ./testdata/grepinput*) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 56 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -c lazy ./testdata/grepinput*) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 57 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -c -l lazy ./testdata/grepinput*) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 57 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -c -l lazy ./testdata/grepinput*) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 58 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --regex=PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 58 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --regex=PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 59 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --regexp=PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 59 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --regexp=PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 60 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --regex PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 60 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --regex PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 61 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --regexp PATTERN ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 61 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --regexp PATTERN ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 62 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --match-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 62 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --match-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 63 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --recursion-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 63 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --recursion-limit=1000 --no-jit -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 64 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o1 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 64 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o1 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 65 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 65 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 66 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o3 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 66 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o3 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 67 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o12 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 67 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o12 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 68 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --only-matching=2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 68 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --only-matching=2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 69 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -vn --colour=always pattern ./testdata/grepinputx) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 69 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -vn --colour=always pattern ./testdata/grepinputx) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 70 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --color=always -M "triple:\t.*\n\n" ./testdata/grepinput3) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 70 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --color=always -M "triple:\t.*\n\n" ./testdata/grepinput3) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 71 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 71 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 72 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 72 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 73 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 73 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 74 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o "^01|02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 75 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --color=always "^01|02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 76 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|02|^03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 77 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 78 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 79 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|03" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 80 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o "\b01|\b02" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 81 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --color=always "\\b01|\\b02" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 82 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o --colour=always "\\b01|\\b02" ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 83 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --buffer-size=100 "^a" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 74 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o "^01|02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 75 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --color=always "^01|02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 76 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|02|^03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 77 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o "^01|^02|03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 78 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --color=always "^01|^02|03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 79 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o --colour=always "^01|^02|03" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 80 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o "\b01|\b02" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 81 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --color=always "\\b01|\\b02" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 82 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o --colour=always "\\b01|\\b02" ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 83 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --buffer-size=100 "^a" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 84 -----------------------------" >>testtry
echo testdata/grepinput3 >testtemp1
(cd $srcdir; $valgrind $pcregrep --file-list ./testdata/grepfilelist --file-list $builddir/testtemp1 "fox|complete|t7") >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 85 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --file-list=./testdata/grepfilelist "dolor" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 86 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 87 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep "cat" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 88 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -v "cat" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 89 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -I "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 90 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --binary-files=without-match "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 91 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -a "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 92 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --binary-files=text "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 93 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --text "dog" ./testdata/grepbinary) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 94 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --include grepinput8 'fox' ./testdata/grepinput* | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 95 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --file-list ./testdata/grepfilelist --exclude grepinputv "fox|complete") >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 96 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -L -r --include-dir=testdata --exclude '^(?!grepinput)' 'fox' ./test* | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 97 -----------------------------" >>testtry
echo "grepinput$" >testtemp1
echo "grepinput8" >>testtemp1
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude-from $builddir/testtemp1 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 84 -----------------------------" >>testtrygrep
echo testdata/grepinput3 >testtemp1grep
(cd $srcdir; $valgrind $pcregrep --file-list ./testdata/grepfilelist --file-list $builddir/testtemp1grep "fox|complete|t7") >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 85 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --file-list=./testdata/grepfilelist "dolor" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 86 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 87 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep "cat" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 88 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -v "cat" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 89 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -I "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 90 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --binary-files=without-match "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 91 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -a "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 92 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --binary-files=text "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 93 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --text "dog" ./testdata/grepbinary) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 94 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --include grepinput8 'fox' ./testdata/grepinput* | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 95 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --file-list ./testdata/grepfilelist --exclude grepinputv "fox|complete") >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 96 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -L -r --include-dir=testdata --exclude '^(?!grepinput)' 'fox' ./test* | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 97 -----------------------------" >>testtrygrep
echo "grepinput$" >testtemp1grep
echo "grepinput8" >>testtemp1grep
(cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude-from $builddir/testtemp1grep --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 98 -----------------------------" >>testtry
echo "grepinput$" >testtemp1
echo "grepinput8" >>testtemp1
(cd $srcdir; $valgrind $pcregrep -L -r --exclude=grepinput3 --include=grepinput --exclude-from $builddir/testtemp1 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 99 -----------------------------" >>testtry
echo "grepinput$" >testtemp1
echo "grepinput8" >testtemp2
(cd $srcdir; $valgrind $pcregrep -L -r --include grepinput --exclude-from $builddir/testtemp1 --exclude-from=$builddir/testtemp2 --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 98 -----------------------------" >>testtrygrep
echo "grepinput$" >testtemp1grep
echo "grepinput8" >>testtemp1grep
(cd $srcdir; $valgrind $pcregrep -L -r --exclude=grepinput3 --include=grepinput --exclude-from $builddir/testtemp1grep --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 99 -----------------------------" >>testtrygrep
echo "grepinput$" >testtemp1grep
echo "grepinput8" >testtemp2grep
(cd $srcdir; $valgrind $pcregrep -L -r --include grepinput --exclude-from $builddir/testtemp1grep --exclude-from=$builddir/testtemp2grep --exclude-dir='^\.' 'fox' ./testdata | sort) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 100 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -Ho2 --only-matching=1 -o3 '(\w+) binary (\w+)(\.)?' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 100 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -Ho2 --only-matching=1 -o3 '(\w+) binary (\w+)(\.)?' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 101 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -o3 -Ho2 -o12 --only-matching=1 -o3 --colour=always --om-separator='|' '(\w+) binary (\w+)(\.)?' ./testdata/grepinput) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test 101 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -o3 -Ho2 -o12 --only-matching=1 -o3 --colour=always --om-separator='|' '(\w+) binary (\w+)(\.)?' ./testdata/grepinput) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 102 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -n "^$" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 102 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -n "^$" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 103 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --only-matching "^$" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 103 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --only-matching "^$" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 104 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -n --only-matching "^$" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 104 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -n --only-matching "^$" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 105 -----------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep --colour=always "ipsum|" ./testdata/grepinput3) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 105 -----------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep --colour=always "ipsum|" ./testdata/grepinput3) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test 106 -----------------------------" >>testtry
(cd $srcdir; echo "a" | $valgrind $pcregrep -M "|a" ) >>testtry 2>&1
echo "RC=$?" >>testtry
echo "---------------------------- Test 106 -----------------------------" >>testtrygrep
(cd $srcdir; echo "a" | $valgrind $pcregrep -M "|a" ) >>testtrygrep 2>&1
echo "RC=$?" >>testtrygrep
# Now compare the results.
$cf $srcdir/testdata/grepoutput testtry
$cf $srcdir/testdata/grepoutput testtrygrep
if [ $? != 0 ] ; then exit 1; fi
@ -518,15 +518,15 @@ if [ $? != 0 ] ; then exit 1; fi
if [ $utf8 -ne 0 ] ; then
echo "Testing pcregrep UTF-8 features"
echo "---------------------------- Test U1 ------------------------------" >testtry
(cd $srcdir; $valgrind $pcregrep -n -u --newline=any "^X" ./testdata/grepinput8) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test U1 ------------------------------" >testtrygrep
(cd $srcdir; $valgrind $pcregrep -n -u --newline=any "^X" ./testdata/grepinput8) >>testtrygrep
echo "RC=$?" >>testtrygrep
echo "---------------------------- Test U2 ------------------------------" >>testtry
(cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry
echo "RC=$?" >>testtry
echo "---------------------------- Test U2 ------------------------------" >>testtrygrep
(cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtrygrep
echo "RC=$?" >>testtrygrep
$cf $srcdir/testdata/grepoutput8 testtry
$cf $srcdir/testdata/grepoutput8 testtrygrep
if [ $? != 0 ] ; then exit 1; fi
else
@ -542,28 +542,28 @@ fi
# starts with a hyphen. These tests are run in the build directory.
echo "Testing pcregrep newline settings"
printf "abc\rdef\r\nghi\njkl" >testNinput
printf "abc\rdef\r\nghi\njkl" >testNinputgrep
printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
$valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtrygrep
$valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
$valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtrygrep
$valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtrygrep
pattern=`printf 'def\rjkl'`
$valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
$valgrind $pcregrep -n --newline=cr -F "$pattern" testNinputgrep >>testtrygrep
printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
$valgrind $pcregrep -n --newline=crlf -F -f $srcdir/testdata/greppatN4 testNinput >>testtry
printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtrygrep
$valgrind $pcregrep -n --newline=crlf -F -f $srcdir/testdata/greppatN4 testNinputgrep >>testtrygrep
printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
$valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtrygrep
$valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
$valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtrygrep
$valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinputgrep >>testtrygrep
$cf $srcdir/testdata/grepoutputN testtry
$cf $srcdir/testdata/grepoutputN testtrygrep
if [ $? != 0 ] ; then exit 1; fi
exit 0

42
pcre/RunTest

@ -31,6 +31,11 @@
# except test 10. Whatever order the arguments are in, the tests are always run
# in numerical order.
#
# The special argument "3S" runs test 3, stopping if it fails. Test 3 is the
# locale test, and failure usually means there's an issue with the locale
# rather than a bug in PCRE, so normally subsequent tests are run. "3S" is
# useful when you want to debug or update the test.
#
# Inappropriate tests are automatically skipped (with a comment to say so): for
# example, if JIT support is not compiled, test 12 is skipped, whereas if JIT
# support is compiled, test 13 is skipped.
@ -458,8 +463,9 @@ fi
# Locale-specific tests, provided that either the "fr_FR" or the "french"
# locale is available. The former is the Unix-like standard; the latter is
# for Windows. Another possibility is "fr", which needs to be run against
# the Windows-specific input and output files.
# for Windows. Another possibility is "fr". Unfortunately, different versions
# of the French locale give different outputs for some items. This test passes
# if the output matches any one of the alternative output files.
if [ $do3 = yes ] ; then
locale -a | grep '^fr_FR$' >/dev/null
@ -467,20 +473,28 @@ if [ $do3 = yes ] ; then
locale=fr_FR
infile=$testdata/testinput3
outfile=$testdata/testoutput3
outfile2=$testdata/testoutput3A
outfile3=$testdata/testoutput3B
else
infile=test3input
outfile=test3output
outfile2=test3outputA
outfile3=test3outputB
locale -a | grep '^french$' >/dev/null
if [ $? -eq 0 ] ; then
locale=french
sed 's/fr_FR/french/' $testdata/testinput3 >test3input
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
else
locale -a | grep '^fr$' >/dev/null
if [ $? -eq 0 ] ; then
locale=fr
sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
else
locale=
fi
@ -492,18 +506,20 @@ if [ $do3 = yes ] ; then
for opt in "" "-s" $jitopt; do
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry
if [ $? = 0 ] ; then
$cf $outfile testtry
if [ $? != 0 ] ; then
echo " "
echo "Locale test did not run entirely successfully."
echo "This usually means that there is a problem with the locale"
echo "settings rather than a bug in PCRE."
break;
else
if $cf $outfile testtry >teststdout || \
$cf $outfile2 testtry >teststdout || \
$cf $outfile3 testtry >teststdout
then
if [ "$opt" = "-s" ] ; then echo " OK with study"
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
else echo " OK"
fi
else
echo "** Locale test did not run successfully. The output did not match"
echo " $outfile, $outfile2 or $outfile3."
echo " This may mean that there is a problem with the locale settings rather"
echo " than a bug in PCRE."
exit 1
fi
else exit 1
fi
@ -989,6 +1005,6 @@ fi
done
# Clean up local working files
rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry
# End

32
pcre/configure.ac

@ -9,17 +9,17 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre_major, [8])
m4_define(pcre_minor, [34])
m4_define(pcre_minor, [35])
m4_define(pcre_prerelease, [])
m4_define(pcre_date, [2013-12-15])
m4_define(pcre_date, [2014-04-04])
# NOTE: The CMakeLists.txt file searches for the above variables in the first
# 50 lines of this file. Please update that if the variables above are moved.
# Libtool shared library interface versions (current:revision:age)
m4_define(libpcre_version, [3:2:2])
m4_define(libpcre16_version, [2:2:2])
m4_define(libpcre32_version, [0:2:0])
m4_define(libpcre_version, [3:3:2])
m4_define(libpcre16_version, [2:3:2])
m4_define(libpcre32_version, [0:3:0])
m4_define(libpcreposix_version, [0:2:0])
m4_define(libpcrecpp_version, [0:0:0])
@ -248,7 +248,7 @@ AC_ARG_ENABLE(pcregrep-libbz2,
# Handle --with-pcregrep-bufsize=N
AC_ARG_WITH(pcregrep-bufsize,
AS_HELP_STRING([--with-pcregrep-bufsize=N],
[pcregrep buffer size (default=20480)]),
[pcregrep buffer size (default=20480, minimum=8192)]),
, with_pcregrep_bufsize=20480)
# Handle --enable-pcretest-libedit
@ -461,7 +461,8 @@ sure both macros are undefined; an emulation function will then be used. */])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h windows.h)
AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h)
AC_CHECK_HEADERS([windows.h], [HAVE_WINDOWS_H=1])
# The files below are C++ header files.
pcre_have_type_traits="0"
@ -686,11 +687,15 @@ if test "$enable_pcre32" = "yes"; then
Define to any value to enable the 32 bit PCRE library.])
fi
# Unless running under Windows, JIT support requires pthreads.
if test "$enable_jit" = "yes"; then
AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
CC="$PTHREAD_CC"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
if test "$HAVE_WINDOWS_H" != "1"; then
AX_PTHREAD([], [AC_MSG_ERROR([JIT support requires pthreads])])
CC="$PTHREAD_CC"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
fi
AC_DEFINE([SUPPORT_JIT], [], [
Define to any value to enable support for Just-In-Time compiling.])
else
@ -739,7 +744,12 @@ if test "$enable_pcregrep_libbz2" = "yes"; then
fi
if test $with_pcregrep_bufsize -lt 8192 ; then
AC_MSG_WARN([$with_pcregrep_bufsize is too small for --with-pcregrep-bufsize; using 8192])
with_pcregrep_bufsize="8192"
else
if test $? -gt 1 ; then
AC_MSG_ERROR([Bad value for --with-pcregrep-bufsize])
fi
fi
AC_DEFINE_UNQUOTED([PCREGREP_BUFSIZE], [$with_pcregrep_bufsize], [

21
pcre/doc/html/README.txt

@ -85,11 +85,12 @@ documentation is supplied in two other forms:
1. There are files called doc/pcre.txt, doc/pcregrep.txt, and
doc/pcretest.txt in the source distribution. The first of these is a
concatenation of the text forms of all the section 3 man pages except
those that summarize individual functions. The other two are the text
forms of the section 1 man pages for the pcregrep and pcretest commands.
These text forms are provided for ease of scanning with text editors or
similar tools. They are installed in <prefix>/share/doc/pcre, where
<prefix> is the installation prefix (defaulting to /usr/local).
the listing of pcredemo.c and those that summarize individual functions.
The other two are the text forms of the section 1 man pages for the
pcregrep and pcretest commands. These text forms are provided for ease of
scanning with text editors or similar tools. They are installed in
<prefix>/share/doc/pcre, where <prefix> is the installation prefix
(defaulting to /usr/local).
2. A set of files containing all the documentation in HTML form, hyperlinked
in various ways, and rooted in a file called index.html, is distributed in
@ -372,12 +373,12 @@ library. They are also documented in the pcrebuild man page.
Of course, the relevant libraries must be installed on your system.
. The default size of internal buffer used by pcregrep can be set by, for
example:
. The default size (in bytes) of the internal buffer used by pcregrep can be
set by, for example:
--with-pcregrep-bufsize=50K
--with-pcregrep-bufsize=51200
The default value is 20K.
The value must be a plain integer. The default is 20480.
. It is possible to compile pcretest so that it links with the libreadline
or libedit libraries, by specifying, respectively,
@ -987,4 +988,4 @@ pcre_xxx, one with the name pcre16_xx, and a third with the name pcre32_xxx.
Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
Last updated: 05 November 2013
Last updated: 17 January 2014

15
pcre/doc/html/pcre.html

@ -154,8 +154,11 @@ page.
The user documentation for PCRE comprises a number of different sections. In
the "man" format, each of these is a separate "man page". In the HTML format,
each is a separate page, linked from the index page. In the plain text format,
all the sections, except the <b>pcredemo</b> section, are concatenated, for ease
of searching. The sections are as follows:
the descriptions of the <b>pcregrep</b> and <b>pcretest</b> programs are in files
called <b>pcregrep.txt</b> and <b>pcretest.txt</b>, respectively. The remaining
sections, except for the <b>pcredemo</b> section (which is a program listing),
are concatenated in <b>pcre.txt</b>, for ease of searching. The sections are as
follows:
<pre>
pcre this document
pcre-config show PCRE installation configuration information
@ -182,8 +185,8 @@ of searching. The sections are as follows:
pcretest description of the <b>pcretest</b> testing command
pcreunicode discussion of Unicode and UTF-8/16/32 support
</pre>
In addition, in the "man" and HTML formats, there is a short page for each
C library function, listing its arguments and results.
In the "man" and HTML formats, there is also a short page for each C library
function, listing its arguments and results.
</P>
<br><a name="SEC4" href="#TOC1">AUTHOR</a><br>
<P>
@ -201,9 +204,9 @@ two digits 10, at the domain cam.ac.uk.
</P>
<br><a name="SEC5" href="#TOC1">REVISION</a><br>
<P>
Last updated: 13 May 2013
Last updated: 08 January 2014
<br>
Copyright &copy; 1997-2013 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

114
pcre/doc/html/pcreapi.html

@ -166,6 +166,9 @@ man page, in case the conversion went wrong.
<br>
<br>
<b>int (*pcre_callout)(pcre_callout_block *);</b>
<br>
<br>
<b>int (*pcre_stack_guard)(void);</b>
</P>
<br><a name="SEC5" href="#TOC1">PCRE 8-BIT, 16-BIT, AND 32-BIT LIBRARIES</a><br>
<P>
@ -324,6 +327,15 @@ by the caller to a "callout" function, which PCRE will then call at specified
points during a matching operation. Details are given in the
<a href="pcrecallout.html"><b>pcrecallout</b></a>
documentation.
</P>
<P>
The global variable <b>pcre_stack_guard</b> initially contains NULL. It can be
set by the caller to a function that is called by PCRE whenever it starts
to compile a parenthesized part of a pattern. When parentheses are nested, PCRE
uses recursive function calls, which use up the system stack. This function is
provided so that applications with restricted stacks can force a compilation
error if the stack runs out. The function should return zero if all is well, or
non-zero to force an error.
<a name="newlines"></a></P>
<br><a name="SEC7" href="#TOC1">NEWLINES</a><br>
<P>
@ -369,7 +381,8 @@ controlled in a similar way, but by separate options.
The PCRE functions can be used in multi-threading applications, with the
proviso that the memory management functions pointed to by <b>pcre_malloc</b>,
<b>pcre_free</b>, <b>pcre_stack_malloc</b>, and <b>pcre_stack_free</b>, and the
callout function pointed to by <b>pcre_callout</b>, are shared by all threads.
callout and stack-checking functions pointed to by <b>pcre_callout</b> and
<b>pcre_stack_guard</b>, are shared by all threads.
</P>
<P>
The compiled form of a regular expression is not altered during matching, so
@ -489,7 +502,10 @@ documentation.
The output is a long integer that gives the maximum depth of nesting of
parentheses (of any kind) in a pattern. This limit is imposed to cap the amount
of system stack used when a pattern is compiled. It is specified when PCRE is
built; the default is 250.
built; the default is 250. This limit does not take into account the stack that
may already be used by the calling application. For finer control over
compilation stack usage, you can set a pointer to an external checking function
in <b>pcre_stack_guard</b>.
<pre>
PCRE_CONFIG_MATCH_LIMIT
</pre>
@ -1008,6 +1024,8 @@ have fallen out of use. To avoid confusion, they have not been re-used.
81 missing opening brace after \o
82 parentheses are too deeply nested
83 invalid range in character class
84 group name must start with a non-digit
85 parentheses are too deeply nested (stack check)
</pre>
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may
be used if the limits were changed when PCRE was built.
@ -1265,12 +1283,15 @@ information call is provided for internal use by the <b>pcre_study()</b>
function. External callers can cause PCRE to use its internal tables by passing
a NULL table pointer.
<pre>
PCRE_INFO_FIRSTBYTE
PCRE_INFO_FIRSTBYTE (deprecated)
</pre>
Return information about the first data unit of any matched string, for a
non-anchored pattern. (The name of this option refers to the 8-bit library,
where data units are bytes.) The fourth argument should point to an <b>int</b>
variable.
non-anchored pattern. The name of this option refers to the 8-bit library,
where data units are bytes. The fourth argument should point to an <b>int</b>
variable. Negative values are used for special cases. However, this means that
when the 32-bit library is in non-UTF-32 mode, the full 32-bit range of
characters cannot be returned. For this reason, this value is deprecated; use
PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead.
</P>
<P>
If there is a fixed first value, for example, the letter "c" from a pattern
@ -1293,12 +1314,43 @@ starts with "^", or
-1 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise -2 is
returned. For anchored patterns, -2 is returned.
<pre>
PCRE_INFO_FIRSTCHARACTER
</pre>
Return the value of the first data unit (non-UTF character) of any matched
string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1;
otherwise return 0. The fourth argument should point to an <b>uint_t</b>
variable.
</P>
<P>
Since for the 32-bit library using the non-UTF-32 mode, this function is unable
to return the full 32-bit range of the character, this value is deprecated;
instead the PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER values
should be used.
In the 8-bit library, the value is always less than 256. In the 16-bit library
the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value
can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.
<pre>
PCRE_INFO_FIRSTCHARACTERFLAGS
</pre>
Return information about the first data unit of any matched string, for a
non-anchored pattern. The fourth argument should point to an <b>int</b>
variable.
</P>
<P>
If there is a fixed first value, for example, the letter "c" from a pattern
such as (cat|cow|coyote), 1 is returned, and the character value can be
retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and
if either
<br>
<br>
(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch
starts with "^", or
<br>
<br>
(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set
(if it were set, the pattern would be anchored),
<br>
<br>
2 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise 0 is
returned. For anchored patterns, 0 is returned.
<pre>
PCRE_INFO_FIRSTTABLE
</pre>
@ -1508,44 +1560,6 @@ above). The format of the <i>study_data</i> block is private, but its length
is made available via this option so that it can be saved and restored (see the
<a href="pcreprecompile.html"><b>pcreprecompile</b></a>
documentation for details).
<pre>
PCRE_INFO_FIRSTCHARACTERFLAGS
</pre>
Return information about the first data unit of any matched string, for a
non-anchored pattern. The fourth argument should point to an <b>int</b>
variable.
</P>
<P>
If there is a fixed first value, for example, the letter "c" from a pattern
such as (cat|cow|coyote), 1 is returned, and the character value can be
retrieved using PCRE_INFO_FIRSTCHARACTER.
</P>
<P>
If there is no fixed first value, and if either
<br>
<br>
(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch
starts with "^", or
<br>
<br>
(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set
(if it were set, the pattern would be anchored),
<br>
<br>
2 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise 0 is
returned. For anchored patterns, 0 is returned.
<pre>
PCRE_INFO_FIRSTCHARACTER
</pre>
Return the fixed first character value in the situation where
PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; otherwise return 0. The fourth
argument should point to an <b>uint_t</b> variable.
</P>
<P>
In the 8-bit library, the value is always less than 256. In the 16-bit library
the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value
can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.
<pre>
PCRE_INFO_REQUIREDCHARFLAGS
</pre>
@ -2899,9 +2913,9 @@ Cambridge CB2 3QH, England.
</P>
<br><a name="SEC26" href="#TOC1">REVISION</a><br>
<P>
Last updated: 12 November 2013
Last updated: 09 February 2014
<br>
Copyright &copy; 1997-2013 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

8
pcre/doc/html/pcregrep.html

@ -37,8 +37,10 @@ man page, in case the conversion went wrong.
<b>pcregrep</b> searches files for character patterns, in the same way as other
grep commands do, but it uses the PCRE regular expression library to support
patterns that are compatible with the regular expressions of Perl 5. See
<a href="pcresyntax.html"><b>pcresyntax</b>(3)</a>
for a quick-reference summary of pattern syntax, or
<a href="pcrepattern.html"><b>pcrepattern</b>(3)</a>
for a full description of syntax and semantics of the regular expressions
for a full description of the syntax and semantics of the regular expressions
that PCRE supports.
</P>
<P>
@ -748,9 +750,9 @@ Cambridge CB2 3QH, England.
</P>
<br><a name="SEC14" href="#TOC1">REVISION</a><br>
<P>
Last updated: 13 September 2012
Last updated: 03 April 2014
<br>
Copyright &copy; 1997-2012 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

25
pcre/doc/html/pcrepattern.html

@ -1003,7 +1003,9 @@ matches "foobar", the first substring is still set to "foo".
<P>
Perl documents that the use of \K within assertions is "not well defined". In
PCRE, \K is acted upon when it occurs inside positive assertions, but is
ignored in negative assertions.
ignored in negative assertions. Note that when a pattern such as (?=ab\K)
matches, the reported start of the match can be greater than the end of the
match.
<a name="smallassertions"></a></P>
<br><b>
Simple assertions
@ -2990,19 +2992,22 @@ match does not always guarantee that a match must be at this starting point.
<P>
Note that (*COMMIT) at the start of a pattern is not the same as an anchor,
unless PCRE's start-of-match optimizations are turned off, as shown in this
<b>pcretest</b> example:
output from <b>pcretest</b>:
<pre>
re&#62; /(*COMMIT)abc/
data&#62; xyzabc
0: abc
xyzabc\Y
data&#62; xyzabc\Y
No match
</pre>
PCRE knows that any match must start with "a", so the optimization skips along
the subject to "a" before running the first match attempt, which succeeds. When
the optimization is disabled by the \Y escape in the second subject, the match
starts at "x" and so the (*COMMIT) causes it to fail without trying any other
starting points.
For this pattern, PCRE knows that any match must start with "a", so the
optimization skips along the subject to "a" before applying the pattern to the
first set of data. The match attempt then succeeds. In the second set of data,
the escape sequence \Y is interpreted by the <b>pcretest</b> program. It causes
the PCRE_NO_START_OPTIMIZE option to be set when <b>pcre_exec()</b> is called.
This disables the optimization that skips along to the first character. The
pattern is now applied starting at "x", and so the (*COMMIT) causes the match
to fail without trying any other starting points.
<pre>
(*PRUNE) or (*PRUNE:NAME)
</pre>
@ -3221,9 +3226,9 @@ Cambridge CB2 3QH, England.
</P>
<br><a name="SEC30" href="#TOC1">REVISION</a><br>
<P>
Last updated: 03 December 2013
Last updated: 08 January 2014
<br>
Copyright &copy; 1997-2013 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

79
pcre/doc/html/pcresyntax.html

@ -29,13 +29,13 @@ man page, in case the conversion went wrong.
<li><a name="TOC14" href="#SEC14">ATOMIC GROUPS</a>
<li><a name="TOC15" href="#SEC15">COMMENT</a>
<li><a name="TOC16" href="#SEC16">OPTION SETTING</a>
<li><a name="TOC17" href="#SEC17">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a>
<li><a name="TOC18" href="#SEC18">BACKREFERENCES</a>
<li><a name="TOC19" href="#SEC19">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a>
<li><a name="TOC20" href="#SEC20">CONDITIONAL PATTERNS</a>
<li><a name="TOC21" href="#SEC21">BACKTRACKING CONTROL</a>
<li><a name="TOC22" href="#SEC22">NEWLINE CONVENTIONS</a>
<li><a name="TOC23" href="#SEC23">WHAT \R MATCHES</a>
<li><a name="TOC17" href="#SEC17">NEWLINE CONVENTION</a>
<li><a name="TOC18" href="#SEC18">WHAT \R MATCHES</a>
<li><a name="TOC19" href="#SEC19">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a>
<li><a name="TOC20" href="#SEC20">BACKREFERENCES</a>
<li><a name="TOC21" href="#SEC21">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a>
<li><a name="TOC22" href="#SEC22">CONDITIONAL PATTERNS</a>
<li><a name="TOC23" href="#SEC23">BACKTRACKING CONTROL</a>
<li><a name="TOC24" href="#SEC24">CALLOUTS</a>
<li><a name="TOC25" href="#SEC25">SEE ALSO</a>
<li><a name="TOC26" href="#SEC26">AUTHOR</a>
@ -339,7 +339,8 @@ but some of them use Unicode properties if PCRE_UCP is set. You can use
<P>
<pre>
\K reset start of match
</PRE>
</pre>
\K is honoured in positive assertions, but ignored in negative ones.
</P>
<br><a name="SEC12" href="#TOC1">ALTERNATION</a><br>
<P>
@ -382,11 +383,13 @@ but some of them use Unicode properties if PCRE_UCP is set. You can use
(?x) extended (ignore white space)
(?-...) unset option(s)
</pre>
The following are recognized only at the start of a pattern or after one of the
newline-setting options with similar syntax:
The following are recognized only at the very start of a pattern or after one
of the newline or \R options with similar syntax. More than one of them may
appear.
<pre>
(*LIMIT_MATCH=d) set the match limit to d (decimal number)
(*LIMIT_RECURSION=d) set the recursion limit to d (decimal number)
(*NO_AUTO_POSSESS) no auto-possessification (PCRE_NO_AUTO_POSSESS)
(*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE)
(*UTF8) set UTF-8 mode: 8-bit library (PCRE_UTF8)
(*UTF16) set UTF-16 mode: 16-bit library (PCRE_UTF16)
@ -397,7 +400,28 @@ newline-setting options with similar syntax:
Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value of the
limits set by the caller of pcre_exec(), not increase them.
</P>
<br><a name="SEC17" href="#TOC1">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a><br>
<br><a name="SEC17" href="#TOC1">NEWLINE CONVENTION</a><br>
<P>
These are recognized only at the very start of the pattern or after option
settings with a similar syntax.
<pre>
(*CR) carriage return only
(*LF) linefeed only
(*CRLF) carriage return followed by linefeed
(*ANYCRLF) all three of the above
(*ANY) any Unicode newline sequence
</PRE>
</P>
<br><a name="SEC18" href="#TOC1">WHAT \R MATCHES</a><br>
<P>
These are recognized only at the very start of the pattern or after option
setting with a similar syntax.
<pre>
(*BSR_ANYCRLF) CR, LF, or CRLF
(*BSR_UNICODE) any Unicode newline sequence
</PRE>
</P>
<br><a name="SEC19" href="#TOC1">LOOKAHEAD AND LOOKBEHIND ASSERTIONS</a><br>
<P>
<pre>
(?=...) positive look ahead
@ -407,7 +431,7 @@ limits set by the caller of pcre_exec(), not increase them.
</pre>
Each top-level branch of a look behind must be of a fixed length.
</P>
<br><a name="SEC18" href="#TOC1">BACKREFERENCES</a><br>
<br><a name="SEC20" href="#TOC1">BACKREFERENCES</a><br>
<P>
<pre>
\n reference by number (can be ambiguous)
@ -421,7 +445,7 @@ Each top-level branch of a look behind must be of a fixed length.
(?P=name) reference by name (Python)
</PRE>
</P>
<br><a name="SEC19" href="#TOC1">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a><br>
<br><a name="SEC21" href="#TOC1">SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)</a><br>
<P>
<pre>
(?R) recurse whole pattern
@ -440,7 +464,7 @@ Each top-level branch of a look behind must be of a fixed length.
\g'-n' call subpattern by relative number (PCRE extension)
</PRE>
</P>
<br><a name="SEC20" href="#TOC1">CONDITIONAL PATTERNS</a><br>
<br><a name="SEC22" href="#TOC1">CONDITIONAL PATTERNS</a><br>
<P>
<pre>
(?(condition)yes-pattern)
@ -459,7 +483,7 @@ Each top-level branch of a look behind must be of a fixed length.
(?(assert)... assertion condition
</PRE>
</P>
<br><a name="SEC21" href="#TOC1">BACKTRACKING CONTROL</a><br>
<br><a name="SEC23" href="#TOC1">BACKTRACKING CONTROL</a><br>
<P>
The following act immediately they are reached:
<pre>
@ -482,27 +506,6 @@ pattern is not anchored.
(*THEN:NAME) equivalent to (*MARK:NAME)(*THEN)
</PRE>
</P>
<br><a name="SEC22" href="#TOC1">NEWLINE CONVENTIONS</a><br>
<P>
These are recognized only at the very start of the pattern or after a
(*BSR_...), (*UTF8), (*UTF16), (*UTF32) or (*UCP) option.
<pre>
(*CR) carriage return only
(*LF) linefeed only
(*CRLF) carriage return followed by linefeed
(*ANYCRLF) all three of the above
(*ANY) any Unicode newline sequence
</PRE>
</P>
<br><a name="SEC23" href="#TOC1">WHAT \R MATCHES</a><br>
<P>
These are recognized only at the very start of the pattern or after a
(*...) option that sets the newline convention or a UTF or UCP mode.
<pre>
(*BSR_ANYCRLF) CR, LF, or CRLF
(*BSR_UNICODE) any Unicode newline sequence
</PRE>
</P>
<br><a name="SEC24" href="#TOC1">CALLOUTS</a><br>
<P>
<pre>
@ -526,9 +529,9 @@ Cambridge CB2 3QH, England.
</P>
<br><a name="SEC27" href="#TOC1">REVISION</a><br>
<P>
Last updated: 12 November 2013
Last updated: 08 January 2014
<br>
Copyright &copy; 1997-2013 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

21
pcre/doc/html/pcretest.html

@ -138,6 +138,9 @@ following options output the value and set the exit code as indicated:
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
</pre>
The following options output 1 for true or 0 for false, and set the exit code
to the same value:
@ -373,6 +376,7 @@ sections.
<b>/N</b> set PCRE_NO_AUTO_CAPTURE
<b>/O</b> set PCRE_NO_AUTO_POSSESS
<b>/P</b> use the POSIX wrapper
<b>/Q</b> test external stack check function
<b>/S</b> study the pattern after compilation
<b>/s</b> set PCRE_DOTALL
<b>/T</b> select character tables
@ -534,7 +538,10 @@ below.
The <b>/I</b> modifier requests that <b>pcretest</b> output information about the
compiled pattern (whether it is anchored, has a fixed first character, and
so on). It does this by calling <b>pcre[16|32]_fullinfo()</b> after compiling a
pattern. If the pattern is studied, the results of that are also output.
pattern. If the pattern is studied, the results of that are also output. In
this output, the word "char" means a non-UTF character, that is, the value of a
single data item (8-bit, 16-bit, or 32-bit, depending on the library that is
being tested).
</P>
<P>
The <b>/K</b> modifier requests <b>pcretest</b> to show names from backtracking
@ -568,6 +575,14 @@ successfully studied with the PCRE_STUDY_JIT_COMPILE option, the size of the
JIT compiled code is also output.
</P>
<P>
The <b>/Q</b> modifier is used to test the use of <b>pcre_stack_guard</b>. It
must be followed by '0' or '1', specifying the return code to be given from an
external function that is passed to PCRE and used for stack checking during
compilation (see the
<a href="pcreapi.html"><b>pcreapi</b></a>
documentation for details).
</P>
<P>
The <b>/S</b> modifier causes <b>pcre[16|32]_study()</b> to be called after the
expression has been compiled, and the results used when the expression is
matched. There are a number of qualifying characters that may follow <b>/S</b>.
@ -1134,9 +1149,9 @@ Cambridge CB2 3QH, England.
</P>
<br><a name="SEC17" href="#TOC1">REVISION</a><br>
<P>
Last updated: 12 November 2013
Last updated: 09 February 2014
<br>
Copyright &copy; 1997-2013 University of Cambridge.
Copyright &copy; 1997-2014 University of Cambridge.
<br>
<p>
Return to the <a href="index.html">PCRE index page</a>.

17
pcre/doc/pcre.3

@ -1,4 +1,4 @@
.TH PCRE 3 "01 Oct 2013" "PCRE 8.33"
.TH PCRE 3 "08 January 2014" "PCRE 8.35"
.SH NAME
PCRE - Perl-compatible regular expressions
.SH INTRODUCTION
@ -158,8 +158,11 @@ page.
The user documentation for PCRE comprises a number of different sections. In
the "man" format, each of these is a separate "man page". In the HTML format,
each is a separate page, linked from the index page. In the plain text format,
all the sections, except the \fBpcredemo\fP section, are concatenated, for ease
of searching. The sections are as follows:
the descriptions of the \fBpcregrep\fP and \fBpcretest\fP programs are in files
called \fBpcregrep.txt\fP and \fBpcretest.txt\fP, respectively. The remaining
sections, except for the \fBpcredemo\fP section (which is a program listing),
are concatenated in \fBpcre.txt\fP, for ease of searching. The sections are as
follows:
.sp
pcre this document
pcre-config show PCRE installation configuration information
@ -188,8 +191,8 @@ of searching. The sections are as follows:
pcretest description of the \fBpcretest\fP testing command
pcreunicode discussion of Unicode and UTF-8/16/32 support
.sp
In addition, in the "man" and HTML formats, there is a short page for each
C library function, listing its arguments and results.
In the "man" and HTML formats, there is also a short page for each C library
function, listing its arguments and results.
.
.
.SH AUTHOR
@ -210,6 +213,6 @@ two digits 10, at the domain cam.ac.uk.
.rs
.sp
.nf
Last updated: 13 May 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 08 January 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

1323
pcre/doc/pcre.txt
File diff suppressed because it is too large
View File

104
pcre/doc/pcreapi.3

@ -1,4 +1,4 @@
.TH PCREAPI 3 "12 November 2013" "PCRE 8.34"
.TH PCREAPI 3 "09 February 2014" "PCRE 8.35"
.SH NAME
PCRE - Perl-compatible regular expressions
.sp
@ -116,6 +116,8 @@ PCRE - Perl-compatible regular expressions
.B void (*pcre_stack_free)(void *);
.sp
.B int (*pcre_callout)(pcre_callout_block *);
.sp
.B int (*pcre_stack_guard)(void);
.fi
.
.
@ -286,6 +288,14 @@ points during a matching operation. Details are given in the
\fBpcrecallout\fP
.\"
documentation.
.P
The global variable \fBpcre_stack_guard\fP initially contains NULL. It can be
set by the caller to a function that is called by PCRE whenever it starts
to compile a parenthesized part of a pattern. When parentheses are nested, PCRE
uses recursive function calls, which use up the system stack. This function is
provided so that applications with restricted stacks can force a compilation
error if the stack runs out. The function should return zero if all is well, or
non-zero to force an error.
.
.
.\" HTML <a name="newlines"></a>
@ -337,7 +347,8 @@ controlled in a similar way, but by separate options.
The PCRE functions can be used in multi-threading applications, with the
proviso that the memory management functions pointed to by \fBpcre_malloc\fP,
\fBpcre_free\fP, \fBpcre_stack_malloc\fP, and \fBpcre_stack_free\fP, and the
callout function pointed to by \fBpcre_callout\fP, are shared by all threads.
callout and stack-checking functions pointed to by \fBpcre_callout\fP and
\fBpcre_stack_guard\fP, are shared by all threads.
.P
The compiled form of a regular expression is not altered during matching, so
the same compiled pattern can safely be used by several threads at once.
@ -465,7 +476,10 @@ documentation.
The output is a long integer that gives the maximum depth of nesting of
parentheses (of any kind) in a pattern. This limit is imposed to cap the amount
of system stack used when a pattern is compiled. It is specified when PCRE is
built; the default is 250.
built; the default is 250. This limit does not take into account the stack that
may already be used by the calling application. For finer control over
compilation stack usage, you can set a pointer to an external checking function
in \fBpcre_stack_guard\fP.
.sp
PCRE_CONFIG_MATCH_LIMIT
.sp
@ -991,6 +1005,8 @@ have fallen out of use. To avoid confusion, they have not been re-used.
81 missing opening brace after \eo
82 parentheses are too deeply nested
83 invalid range in character class
84 group name must start with a non-digit
85 parentheses are too deeply nested (stack check)
.sp
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may
be used if the limits were changed when PCRE was built.
@ -1248,12 +1264,15 @@ information call is provided for internal use by the \fBpcre_study()\fP
function. External callers can cause PCRE to use its internal tables by passing
a NULL table pointer.
.sp
PCRE_INFO_FIRSTBYTE
PCRE_INFO_FIRSTBYTE (deprecated)
.sp
Return information about the first data unit of any matched string, for a
non-anchored pattern. (The name of this option refers to the 8-bit library,
where data units are bytes.) The fourth argument should point to an \fBint\fP
variable.
non-anchored pattern. The name of this option refers to the 8-bit library,
where data units are bytes. The fourth argument should point to an \fBint\fP
variable. Negative values are used for special cases. However, this means that
when the 32-bit library is in non-UTF-32 mode, the full 32-bit range of
characters cannot be returned. For this reason, this value is deprecated; use
PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER instead.
.P
If there is a fixed first value, for example, the letter "c" from a pattern
such as (cat|cow|coyote), its value is returned. In the 8-bit library, the
@ -1271,11 +1290,38 @@ starts with "^", or
-1 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise -2 is
returned. For anchored patterns, -2 is returned.
.sp
PCRE_INFO_FIRSTCHARACTER
.sp
Return the value of the first data unit (non-UTF character) of any matched
string in the situation where PCRE_INFO_FIRSTCHARACTERFLAGS returns 1;
otherwise return 0. The fourth argument should point to an \fBuint_t\fP
variable.
.P
Since for the 32-bit library using the non-UTF-32 mode, this function is unable
to return the full 32-bit range of the character, this value is deprecated;
instead the PCRE_INFO_FIRSTCHARACTERFLAGS and PCRE_INFO_FIRSTCHARACTER values
should be used.
In the 8-bit library, the value is always less than 256. In the 16-bit library
the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value
can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.
.sp
PCRE_INFO_FIRSTCHARACTERFLAGS
.sp
Return information about the first data unit of any matched string, for a
non-anchored pattern. The fourth argument should point to an \fBint\fP
variable.
.P
If there is a fixed first value, for example, the letter "c" from a pattern
such as (cat|cow|coyote), 1 is returned, and the character value can be
retrieved using PCRE_INFO_FIRSTCHARACTER. If there is no fixed first value, and
if either
.sp
(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch
starts with "^", or
.sp
(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set
(if it were set, the pattern would be anchored),
.sp
2 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise 0 is
returned. For anchored patterns, 0 is returned.
.sp
PCRE_INFO_FIRSTTABLE
.sp
@ -1498,38 +1544,6 @@ is made available via this option so that it can be saved and restored (see the
\fBpcreprecompile\fP
.\"
documentation for details).
.sp
PCRE_INFO_FIRSTCHARACTERFLAGS
.sp
Return information about the first data unit of any matched string, for a
non-anchored pattern. The fourth argument should point to an \fBint\fP
variable.
.P
If there is a fixed first value, for example, the letter "c" from a pattern
such as (cat|cow|coyote), 1 is returned, and the character value can be
retrieved using PCRE_INFO_FIRSTCHARACTER.
.P
If there is no fixed first value, and if either
.sp
(a) the pattern was compiled with the PCRE_MULTILINE option, and every branch
starts with "^", or
.sp
(b) every branch of the pattern starts with ".*" and PCRE_DOTALL is not set
(if it were set, the pattern would be anchored),
.sp
2 is returned, indicating that the pattern matches only at the start of a
subject string or after any newline within the string. Otherwise 0 is
returned. For anchored patterns, 0 is returned.
.sp
PCRE_INFO_FIRSTCHARACTER
.sp
Return the fixed first character value in the situation where
PCRE_INFO_FIRSTCHARACTERFLAGS returns 1; otherwise return 0. The fourth
argument should point to an \fBuint_t\fP variable.
.P
In the 8-bit library, the value is always less than 256. In the 16-bit library
the value can be up to 0xffff. In the 32-bit library in UTF-32 mode the value
can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 mode.
.sp
PCRE_INFO_REQUIREDCHARFLAGS
.sp
@ -2900,6 +2914,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
Last updated: 12 November 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 09 February 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

12
pcre/doc/pcregrep.1

@ -1,4 +1,4 @@
.TH PCREGREP 1 "13 September 2012" "PCRE 8.32"
.TH PCREGREP 1 "03 April 2014" "PCRE 8.35"
.SH NAME
pcregrep - a grep with Perl-compatible regular expressions.
.SH SYNOPSIS
@ -11,9 +11,13 @@ pcregrep - a grep with Perl-compatible regular expressions.
grep commands do, but it uses the PCRE regular expression library to support
patterns that are compatible with the regular expressions of Perl 5. See
.\" HREF
\fBpcresyntax\fP(3)
.\"
for a quick-reference summary of pattern syntax, or
.\" HREF
\fBpcrepattern\fP(3)
.\"
for a full description of syntax and semantics of the regular expressions
for a full description of the syntax and semantics of the regular expressions
that PCRE supports.
.P
Patterns, whether supplied on the command line or in a separate file, are given
@ -674,6 +678,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
Last updated: 13 September 2012
Copyright (c) 1997-2012 University of Cambridge.
Last updated: 03 April 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

709
pcre/doc/pcregrep.txt
File diff suppressed because it is too large
View File

27
pcre/doc/pcrepattern.3

@ -1,4 +1,4 @@
.TH PCREPATTERN 3 "03 December 2013" "PCRE 8.34"
.TH PCREPATTERN 3 "08 January 2014" "PCRE 8.35"
.SH NAME
PCRE - Perl-compatible regular expressions
.SH "PCRE REGULAR EXPRESSION DETAILS"
@ -1004,7 +1004,9 @@ matches "foobar", the first substring is still set to "foo".
.P
Perl documents that the use of \eK within assertions is "not well defined". In
PCRE, \eK is acted upon when it occurs inside positive assertions, but is
ignored in negative assertions.
ignored in negative assertions. Note that when a pattern such as (?=ab\eK)
matches, the reported start of the match can be greater than the end of the
match.
.
.
.\" HTML <a name="smallassertions"></a>
@ -3028,19 +3030,22 @@ match does not always guarantee that a match must be at this starting point.
.P
Note that (*COMMIT) at the start of a pattern is not the same as an anchor,
unless PCRE's start-of-match optimizations are turned off, as shown in this
\fBpcretest\fP example:
output from \fBpcretest\fP:
.sp
re> /(*COMMIT)abc/
data> xyzabc
0: abc
xyzabc\eY
data> xyzabc\eY
No match
.sp
PCRE knows that any match must start with "a", so the optimization skips along
the subject to "a" before running the first match attempt, which succeeds. When
the optimization is disabled by the \eY escape in the second subject, the match
starts at "x" and so the (*COMMIT) causes it to fail without trying any other
starting points.
For this pattern, PCRE knows that any match must start with "a", so the
optimization skips along the subject to "a" before applying the pattern to the
first set of data. The match attempt then succeeds. In the second set of data,
the escape sequence \eY is interpreted by the \fBpcretest\fP program. It causes
the PCRE_NO_START_OPTIMIZE option to be set when \fBpcre_exec()\fP is called.
This disables the optimization that skips along to the first character. The
pattern is now applied starting at "x", and so the (*COMMIT) causes the match
to fail without trying any other starting points.
.sp
(*PRUNE) or (*PRUNE:NAME)
.sp
@ -3255,6 +3260,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
Last updated: 03 December 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 08 January 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

60
pcre/doc/pcresyntax.3

@ -1,4 +1,4 @@
.TH PCRESYNTAX 3 "12 November 2013" "PCRE 8.34"
.TH PCRESYNTAX 3 "08 January 2014" "PCRE 8.35"
.SH NAME
PCRE - Perl-compatible regular expressions
.SH "PCRE REGULAR EXPRESSION SYNTAX SUMMARY"
@ -309,6 +309,8 @@ but some of them use Unicode properties if PCRE_UCP is set. You can use
.rs
.sp
\eK reset start of match
.sp
\eK is honoured in positive assertions, but ignored in negative ones.
.
.
.SH "ALTERNATION"
@ -354,11 +356,13 @@ but some of them use Unicode properties if PCRE_UCP is set. You can use
(?x) extended (ignore white space)
(?-...) unset option(s)
.sp
The following are recognized only at the start of a pattern or after one of the
newline-setting options with similar syntax:
The following are recognized only at the very start of a pattern or after one
of the newline or \eR options with similar syntax. More than one of them may
appear.
.sp
(*LIMIT_MATCH=d) set the match limit to d (decimal number)
(*LIMIT_RECURSION=d) set the recursion limit to d (decimal number)
(*NO_AUTO_POSSESS) no auto-possessification (PCRE_NO_AUTO_POSSESS)
(*NO_START_OPT) no start-match optimization (PCRE_NO_START_OPTIMIZE)
(*UTF8) set UTF-8 mode: 8-bit library (PCRE_UTF8)
(*UTF16) set UTF-16 mode: 16-bit library (PCRE_UTF16)
@ -370,6 +374,29 @@ Note that LIMIT_MATCH and LIMIT_RECURSION can only reduce the value of the
limits set by the caller of pcre_exec(), not increase them.
.
.
.SH "NEWLINE CONVENTION"
.rs
.sp
These are recognized only at the very start of the pattern or after option
settings with a similar syntax.
.sp
(*CR) carriage return only
(*LF) linefeed only
(*CRLF) carriage return followed by linefeed
(*ANYCRLF) all three of the above
(*ANY) any Unicode newline sequence
.
.
.SH "WHAT \eR MATCHES"
.rs
.sp
These are recognized only at the very start of the pattern or after option
setting with a similar syntax.
.sp
(*BSR_ANYCRLF) CR, LF, or CRLF
(*BSR_UNICODE) any Unicode newline sequence
.
.
.SH "LOOKAHEAD AND LOOKBEHIND ASSERTIONS"
.rs
.sp
@ -457,29 +484,6 @@ pattern is not anchored.
(*THEN:NAME) equivalent to (*MARK:NAME)(*THEN)
.
.
.SH "NEWLINE CONVENTIONS"
.rs
.sp
These are recognized only at the very start of the pattern or after a
(*BSR_...), (*UTF8), (*UTF16), (*UTF32) or (*UCP) option.
.sp
(*CR) carriage return only
(*LF) linefeed only
(*CRLF) carriage return followed by linefeed
(*ANYCRLF) all three of the above
(*ANY) any Unicode newline sequence
.
.
.SH "WHAT \eR MATCHES"
.rs
.sp
These are recognized only at the very start of the pattern or after a
(*...) option that sets the newline convention or a UTF or UCP mode.
.sp
(*BSR_ANYCRLF) CR, LF, or CRLF
(*BSR_UNICODE) any Unicode newline sequence
.
.
.SH "CALLOUTS"
.rs
.sp
@ -508,6 +512,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
Last updated: 12 November 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 08 January 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

24
pcre/doc/pcretest.1

@ -1,4 +1,4 @@
.TH PCRETEST 1 "12 November 2013" "PCRE 8.34"
.TH PCRETEST 1 "09 February 2014" "PCRE 8.35"
.SH NAME
pcretest - a program for testing Perl-compatible regular expressions.
.SH SYNOPSIS
@ -113,6 +113,9 @@ following options output the value and set the exit code as indicated:
newline the default newline setting:
CR, LF, CRLF, ANYCRLF, or ANY
exit code is always 0
bsr the default setting for what \eR matches:
ANYCRLF or ANY
exit code is always 0
.sp
The following options output 1 for true or 0 for false, and set the exit code
to the same value:
@ -330,6 +333,7 @@ sections.
\fB/N\fP set PCRE_NO_AUTO_CAPTURE
\fB/O\fP set PCRE_NO_AUTO_POSSESS
\fB/P\fP use the POSIX wrapper
\fB/Q\fP test external stack check function
\fB/S\fP study the pattern after compilation
\fB/s\fP set PCRE_DOTALL
\fB/T\fP select character tables
@ -483,7 +487,10 @@ below.
The \fB/I\fP modifier requests that \fBpcretest\fP output information about the
compiled pattern (whether it is anchored, has a fixed first character, and
so on). It does this by calling \fBpcre[16|32]_fullinfo()\fP after compiling a
pattern. If the pattern is studied, the results of that are also output.
pattern. If the pattern is studied, the results of that are also output. In
this output, the word "char" means a non-UTF character, that is, the value of a
single data item (8-bit, 16-bit, or 32-bit, depending on the library that is
being tested).
.P
The \fB/K\fP modifier requests \fBpcretest\fP to show names from backtracking
control verbs that are returned from calls to \fBpcre[16|32]_exec()\fP. It causes
@ -513,6 +520,15 @@ the compiled pattern to be output. This does not include the size of the
successfully studied with the PCRE_STUDY_JIT_COMPILE option, the size of the
JIT compiled code is also output.
.P
The \fB/Q\fP modifier is used to test the use of \fBpcre_stack_guard\fP. It
must be followed by '0' or '1', specifying the return code to be given from an
external function that is passed to PCRE and used for stack checking during
compilation (see the
.\" HREF
\fBpcreapi\fP
.\"
documentation for details).
.P
The \fB/S\fP modifier causes \fBpcre[16|32]_study()\fP to be called after the
expression has been compiled, and the results used when the expression is
matched. There are a number of qualifying characters that may follow \fB/S\fP.
@ -1135,6 +1151,6 @@ Cambridge CB2 3QH, England.
.rs
.sp
.nf
Last updated: 12 November 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 09 February 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi

375
pcre/doc/pcretest.txt

@ -99,6 +99,9 @@ COMMAND LINE OPTIONS
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:
@ -316,6 +319,7 @@ PATTERN MODIFIERS
/N set PCRE_NO_AUTO_CAPTURE
/O set PCRE_NO_AUTO_POSSESS
/P use the POSIX wrapper
/Q test external stack check function
/S study the pattern after compilation
/s set PCRE_DOTALL
/T select character tables
@ -462,7 +466,9 @@ PATTERN MODIFIERS
compiled pattern (whether it is anchored, has a fixed first character,
and so on). It does this by calling pcre[16|32]_fullinfo() after com-
piling a pattern. If the pattern is studied, the results of that are
also output.
also output. In this output, the word "char" means a non-UTF character,
that is, the value of a single data item (8-bit, 16-bit, or 32-bit,
depending on the library that is being tested).
The /K modifier requests pcretest to show names from backtracking con-
trol verbs that are returned from calls to pcre[16|32]_exec(). It
@ -493,26 +499,31 @@ PATTERN MODIFIERS
pattern is successfully studied with the PCRE_STUDY_JIT_COMPILE option,
the size of the JIT compiled code is also output.
The /S modifier causes pcre[16|32]_study() to be called after the
expression has been compiled, and the results used when the expression
The /Q modifier is used to test the use of pcre_stack_guard. It must be
followed by '0' or '1', specifying the return code to be given from an
external function that is passed to PCRE and used for stack checking
during compilation (see the pcreapi documentation for details).
The /S modifier causes pcre[16|32]_study() to be called after the
expression has been compiled, and the results used when the expression
is matched. There are a number of qualifying characters that may follow
/S. They may appear in any order.
If /S is followed by an exclamation mark, pcre[16|32]_study() is called
with the PCRE_STUDY_EXTRA_NEEDED option, causing it always to return a
with the PCRE_STUDY_EXTRA_NEEDED option, causing it always to return a
pcre_extra block, even when studying discovers no useful information.
If /S is followed by a second S character, it suppresses studying, even
if it was requested externally by the -s command line option. This
makes it possible to specify that certain patterns are always studied,
if it was requested externally by the -s command line option. This
makes it possible to specify that certain patterns are always studied,
and others are never studied, independently of -s. This feature is used
in the test files in a few cases where the output is different when the
pattern is studied.
If the /S modifier is followed by a + character, the call to
pcre[16|32]_study() is made with all the JIT study options, requesting
just-in-time optimization support if it is available, for both normal
and partial matching. If you want to restrict the JIT compiling modes,
If the /S modifier is followed by a + character, the call to
pcre[16|32]_study() is made with all the JIT study options, requesting
just-in-time optimization support if it is available, for both normal
and partial matching. If you want to restrict the JIT compiling modes,
you can follow /S+ with a digit in the range 1 to 7:
1 normal match only
@ -523,40 +534,40 @@ PATTERN MODIFIERS
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
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 is also an independent /+ modifier; it must not be
Note that there is also an independent /+ modifier; it must not be
given immediately after /S or /S+ because this will be misinterpreted.
If JIT studying is successful, the compiled JIT code will automatically
be used when pcre[16|32]_exec() is run, except when incompatible run-
time options are specified. For more details, see the pcrejit documen-
tation. See also the \J escape sequence below for a way of setting the
be used when pcre[16|32]_exec() is run, except when incompatible run-
time options are specified. For more details, see the pcrejit documen-
tation. See also the \J escape sequence below for a way of setting the
size of the JIT stack.
Finally, if /S is followed by a minus character, JIT compilation is
suppressed, even if it was requested externally by the -s command line
option. This makes it possible to specify that JIT is never to be used
Finally, if /S is followed by a minus character, JIT compilation is
suppressed, even if it was requested externally by the -s command line
option. This makes it possible to specify that JIT is never to be used
for certain patterns.
The /T modifier must be followed by a single digit. It causes a spe-
The /T modifier must be followed by a single digit. It causes a spe-
cific set of built-in character tables to be passed to pcre[16|32]_com-
pile(). It is used in the standard PCRE tests to check behaviour with
pile(). It is used in the standard PCRE tests to check behaviour with
different character tables. The digit specifies the tables as follows:
0 the default ASCII tables, as distributed in
pcre_chartables.c.dist
1 a set of tables defining ISO 8859 characters
In table 1, some characters whose codes are greater than 128 are iden-
In table 1, some characters whose codes are greater than 128 are iden-
tified as letters, digits, spaces, etc.
Using the POSIX wrapper API
The /P modifier causes pcretest to call PCRE via the POSIX wrapper API
rather than its native API. This supports only the 8-bit library. When
/P is set, the following modifiers set options for the regcomp() func-
The /P modifier causes pcretest to call PCRE via the POSIX wrapper API
rather than its native API. This supports only the 8-bit library. When
/P is set, the following modifiers set options for the regcomp() func-
tion:
/i REG_ICASE
@ -567,48 +578,48 @@ PATTERN MODIFIERS
/W REG_UCP ) the POSIX standard
/8 REG_UTF8 )
The /+ modifier works as described above. All other modifiers are
The /+ modifier works as described above. All other modifiers are
ignored.
Locking out certain modifiers
PCRE can be compiled with or without support for certain features such
as UTF-8/16/32 or Unicode properties. Accordingly, the standard tests
are split up into a number of different files that are selected for
running depending on which features are available. When updating the
PCRE can be compiled with or without support for certain features such
as UTF-8/16/32 or Unicode properties. Accordingly, the standard tests
are split up into a number of different files that are selected for
running depending on which features are available. When updating the
tests, it is all too easy to put a new test into the wrong file by mis-
take; for example, to put a test that requires UTF support into a file
that is used when it is not available. To help detect such mistakes as
early as possible, there is a facility for locking out specific modi-
take; for example, to put a test that requires UTF support into a file
that is used when it is not available. To help detect such mistakes as
early as possible, there is a facility for locking out specific modi-
fiers. If an input line for pcretest starts with the string "< forbid "
the following sequence of characters is taken as a list of forbidden
the following sequence of characters is taken as a list of forbidden
modifiers. For example, in the test files that must not use UTF or Uni-
code property support, this line appears:
< forbid 8W
This locks out the /8 and /W modifiers. An immediate error is given if
they are subsequently encountered. If the character string contains <
but not >, all the multi-character modifiers that begin with < are
locked out. Otherwise, such modifiers must be explicitly listed, for
This locks out the /8 and /W modifiers. An immediate error is given if
they are subsequently encountered. If the character string contains <
but not >, all the multi-character modifiers that begin with < are
locked out. Otherwise, such modifiers must be explicitly listed, for
example:
< forbid <JS><cr>
There must be a single space between < and "forbid" for this feature to
be recognised. If there is not, the line is interpreted either as a
request to re-load a pre-compiled pattern (see "SAVING AND RELOADING
COMPILED PATTERNS" below) or, if there is a another < character, as a
be recognised. If there is not, the line is interpreted either as a
request to re-load a pre-compiled pattern (see "SAVING AND RELOADING
COMPILED PATTERNS" below) or, if there is a another < character, as a
pattern that uses < as its delimiter.
DATA LINES
Before each data line is passed to pcre[16|32]_exec(), leading and
trailing white space is removed, and it is then scanned for \ escapes.
Some of these are pretty esoteric features, intended for checking out
some of the more complicated features of PCRE. If you are just testing
"ordinary" regular expressions, you probably don't need any of these.
Before each data line is passed to pcre[16|32]_exec(), leading and
trailing white space is removed, and it is then scanned for \ escapes.
Some of these are pretty esoteric features, intended for checking out
some of the more complicated features of PCRE. If you are just testing
"ordinary" regular expressions, you probably don't need any of these.
The following escapes are recognized:
\a alarm (BEL, \x07)
@ -669,7 +680,7 @@ DATA LINES
(any number of digits)
\R pass the PCRE_DFA_RESTART option to pcre[16|32]_dfa_exec()
\S output details of memory get/free calls during matching
\Y pass the PCRE_NO_START_OPTIMIZE option to
\Y pass the PCRE_NO_START_OPTIMIZE option to
pcre[16|32]_exec()
or pcre[16|32]_dfa_exec()
\Z pass the PCRE_NOTEOL option to pcre[16|32]_exec()
@ -678,7 +689,7 @@ DATA LINES
pcre[16|32]_exec() or pcre[16|32]_dfa_exec()
\>dd start the match at offset dd (optional "-"; then
any number of digits); this sets the startoffset
argument for pcre[16|32]_exec() or
argument for pcre[16|32]_exec() or
pcre[16|32]_dfa_exec()
\<cr> pass the PCRE_NEWLINE_CR option to pcre[16|32]_exec()
or pcre[16|32]_dfa_exec()
@ -691,102 +702,102 @@ DATA LINES
\<any> pass the PCRE_NEWLINE_ANY option to pcre[16|32]_exec()
or pcre[16|32]_dfa_exec()
The use of \x{hh...} is not dependent on the use of the /8 modifier on
the pattern. It is recognized always. There may be any number of hexa-
decimal digits inside the braces; invalid values provoke error mes-
The use of \x{hh...} is not dependent on the use of the /8 modifier on
the pattern. It is recognized always. There may be any number of hexa-
decimal digits inside the braces; invalid values provoke error mes-
sages.
Note that \xhh specifies one byte rather than one character in UTF-8
mode; this makes it possible to construct invalid UTF-8 sequences for
testing purposes. On the other hand, \x{hh} is interpreted as a UTF-8
character in UTF-8 mode, generating more than one byte if the value is
greater than 127. When testing the 8-bit library not in UTF-8 mode,
Note that \xhh specifies one byte rather than one character in UTF-8
mode; this makes it possible to construct invalid UTF-8 sequences for
testing purposes. On the other hand, \x{hh} is interpreted as a UTF-8
character in UTF-8 mode, generating more than one byte if the value is
greater than 127. When testing the 8-bit library not in UTF-8 mode,
\x{hh} generates one byte for values less than 256, and causes an error
for greater values.
In UTF-16 mode, all 4-digit \x{hhhh} values are accepted. This makes it
possible to construct invalid UTF-16 sequences for testing purposes.
In UTF-32 mode, all 4- to 8-digit \x{...} values are accepted. This
makes it possible to construct invalid UTF-32 sequences for testing
In UTF-32 mode, all 4- to 8-digit \x{...} values are accepted. This
makes it possible to construct invalid UTF-32 sequences for testing
purposes.
The escapes that specify line ending sequences are literal strings,
The escapes that specify line ending sequences are literal strings,
exactly as shown. No more than one newline setting should be present in
any data line.
A backslash followed by anything else just escapes the anything else.
If the very last character is a backslash, it is ignored. This gives a
way of passing an empty line as data, since a real empty line termi-
A backslash followed by anything else just escapes the anything else.
If the very last character is a backslash, it is ignored. This gives a
way of passing an empty line as data, since a real empty line termi-
nates the data input.
The \J escape provides a way of setting the maximum stack size that is
used by the just-in-time optimization code. It is ignored if JIT opti-
mization is not being used. Providing a stack that is larger than the
The \J escape provides a way of setting the maximum stack size that is
used by the just-in-time optimization code. It is ignored if JIT opti-
mization is not being used. Providing a stack that is larger than the
default 32K is necessary only for very complicated patterns.
If \M is present, pcretest calls pcre[16|32]_exec() several times, with
different values in the match_limit and match_limit_recursion fields of
the pcre[16|32]_extra data structure, until it finds the minimum num-
the pcre[16|32]_extra data structure, until it finds the minimum num-
bers for each parameter that allow pcre[16|32]_exec() to complete with-
out error. Because this is testing a specific feature of the normal
out error. Because this is testing a specific feature of the normal
interpretive pcre[16|32]_exec() execution, the use of any JIT optimiza-
tion that might have been set up by the /S+ qualifier of -s+ option is
tion that might have been set up by the /S+ qualifier of -s+ option is
disabled.
The match_limit number is a measure of the amount of backtracking that
takes place, and checking it out can be instructive. For most simple
matches, the number is quite small, but for patterns with very large
numbers of matching possibilities, it can become large very quickly
with increasing length of subject string. The match_limit_recursion
number is a measure of how much stack (or, if PCRE is compiled with
NO_RECURSE, how much heap) memory is needed to complete the match
The match_limit number is a measure of the amount of backtracking that
takes place, and checking it out can be instructive. For most simple
matches, the number is quite small, but for patterns with very large
numbers of matching possibilities, it can become large very quickly
with increasing length of subject string. The match_limit_recursion
number is a measure of how much stack (or, if PCRE is compiled with
NO_RECURSE, how much heap) memory is needed to complete the match
attempt.
When \O is used, the value specified may be higher or lower than the
When \O is used, the value specified may be higher or lower than the
size set by the -O command line option (or defaulted to 45); \O applies
only to the call of pcre[16|32]_exec() for the line in which it
only to the call of pcre[16|32]_exec() for the line in which it
appears.
If the /P modifier was present on the pattern, causing the POSIX wrap-
per API to be used, the only option-setting sequences that have any
effect are \B, \N, and \Z, causing REG_NOTBOL, REG_NOTEMPTY, and
If the /P modifier was present on the pattern, causing the POSIX wrap-
per API to be used, the only option-setting sequences that have any
effect are \B, \N, and \Z, causing REG_NOTBOL, REG_NOTEMPTY, and
REG_NOTEOL, respectively, to be passed to regexec().
THE ALTERNATIVE MATCHING FUNCTION
By default, pcretest uses the standard PCRE matching function,
pcre[16|32]_exec() to match each data line. PCRE also supports an
alternative matching function, pcre[16|32]_dfa_test(), which operates
in a different way, and has some restrictions. The differences between
By default, pcretest uses the standard PCRE matching function,
pcre[16|32]_exec() to match each data line. PCRE also supports an
alternative matching function, pcre[16|32]_dfa_test(), which operates
in a different way, and has some restrictions. The differences between
the two functions are described in the pcrematching documentation.
If a data line contains the \D escape sequence, or if the command line
contains the -dfa option, the alternative matching function is used.
If a data line contains the \D escape sequence, or if the command line
contains the -dfa option, the alternative matching function is used.
This function finds all possible matches at a given point. If, however,
the \F escape sequence is present in the data line, it stops after the
the \F escape sequence is present in the data line, it stops after the
first match is found. This is always the shortest possible match.
DEFAULT OUTPUT FROM PCRETEST
This section describes the output when the normal matching function,
This section describes the output when the normal matching function,
pcre[16|32]_exec(), is being used.
When a match succeeds, pcretest outputs the list of captured substrings
that pcre[16|32]_exec() returns, starting with number 0 for the string
that matched the whole pattern. Otherwise, it outputs "No match" when
the return is PCRE_ERROR_NOMATCH, and "Partial match:" followed by the
partially matching substring when pcre[16|32]_exec() returns
PCRE_ERROR_PARTIAL. (Note that this is the entire substring that was
inspected during the partial match; it may include characters before
the actual match start if a lookbehind assertion, \K, \b, or \B was
involved.) For any other return, pcretest outputs the PCRE negative
error number and a short descriptive phrase. If the error is a failed
UTF string check, the offset of the start of the failing character and
the reason code are also output, provided that the size of the output
vector is at least two. Here is an example of an interactive pcretest
that pcre[16|32]_exec() returns, starting with number 0 for the string
that matched the whole pattern. Otherwise, it outputs "No match" when
the return is PCRE_ERROR_NOMATCH, and "Partial match:" followed by the
partially matching substring when pcre[16|32]_exec() returns
PCRE_ERROR_PARTIAL. (Note that this is the entire substring that was
inspected during the partial match; it may include characters before
the actual match start if a lookbehind assertion, \K, \b, or \B was
involved.) For any other return, pcretest outputs the PCRE negative
error number and a short descriptive phrase. If the error is a failed
UTF string check, the offset of the start of the failing character and
the reason code are also output, provided that the size of the output
vector is at least two. Here is an example of an interactive pcretest
run.
$ pcretest
@ -800,10 +811,10 @@ DEFAULT OUTPUT FROM PCRETEST
No match
Unset capturing substrings that are not followed by one that is set are
not returned by pcre[16|32]_exec(), and are not shown by pcretest. In
not returned by pcre[16|32]_exec(), and are not shown by pcretest. In
the following example, there are two capturing substrings, but when the
first data line is matched, the second, unset substring is not shown.
An "internal" unset substring is shown as "<unset>", as for the second
first data line is matched, the second, unset substring is not shown.
An "internal" unset substring is shown as "<unset>", as for the second
data line.
re> /(a)|(b)/
@ -815,11 +826,11 @@ DEFAULT OUTPUT FROM PCRETEST
1: <unset>
2: b
If the strings contain any non-printing characters, they are output as
\xhh escapes if the value is less than 256 and UTF mode is not set.
If the strings contain any non-printing characters, they are output as
\xhh escapes if the value is less than 256 and UTF mode is not set.
Otherwise they are output as \x{hh...} escapes. See below for the defi-
nition of non-printing characters. If the pattern has the /+ modifier,
the output for substring 0 is followed by the the rest of the subject
nition of non-printing characters. If the pattern has the /+ modifier,
the output for substring 0 is followed by the the rest of the subject
string, identified by "0+" like this:
re> /cat/+
@ -827,7 +838,7 @@ DEFAULT OUTPUT FROM PCRETEST
0: cat
0+ aract
If the pattern has the /g or /G modifier, the results of successive
If the pattern has the /g or /G modifier, the results of successive
matching attempts are output in sequence, like this:
re> /\Bi(\w\w)/g
@ -839,32 +850,32 @@ DEFAULT OUTPUT FROM PCRETEST
0: ipp
1: pp
"No match" is output only if the first match attempt fails. Here is an
example of a failure message (the offset 4 that is specified by \>4 is
"No match" is output only if the first match attempt fails. Here is an
example of a failure message (the offset 4 that is specified by \>4 is
past the end of the subject string):
re> /xyz/
data> xyz\>4
Error -24 (bad offset value)
If any of the sequences \C, \G, or \L are present in a data line that
is successfully matched, the substrings extracted by the convenience
If any of the sequences \C, \G, or \L are present in a data line that
is successfully matched, the substrings extracted by the convenience
functions are output with C, G, or L after the string number instead of
a colon. This is in addition to the normal full list. The string length
(that is, the return from the extraction function) is given in paren-
(that is, the return from the extraction function) is given in paren-
theses after each string for \C and \G.
Note that whereas patterns can be continued over several lines (a plain
">" prompt is used for continuations), data lines may not. However new-
lines can be included in data by means of the \n escape (or \r, \r\n,
lines can be included in data by means of the \n escape (or \r, \r\n,
etc., depending on the newline sequence setting).
OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
When the alternative matching function, pcre[16|32]_dfa_exec(), is used
(by means of the \D escape sequence or the -dfa command line option),
the output consists of a list of all the matches that start at the
(by means of the \D escape sequence or the -dfa command line option),
the output consists of a list of all the matches that start at the
first point in the subject where there is at least one match. For exam-
ple:
@ -874,11 +885,11 @@ OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
1: tang
2: tan
(Using the normal matching function on this data finds only "tang".)
The longest matching string is always given first (and numbered zero).
(Using the normal matching function on this data finds only "tang".)
The longest matching string is always given first (and numbered zero).
After a PCRE_ERROR_PARTIAL return, the output is "Partial match:", fol-
lowed by the partially matching substring. (Note that this is the
entire substring that was inspected during the partial match; it may
lowed by the partially matching substring. (Note that this is the
entire substring that was inspected during the partial match; it may
include characters before the actual match start if a lookbehind asser-
tion, \K, \b, or \B was involved.)
@ -894,16 +905,16 @@ OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
1: tan
0: tan
Since the matching function does not support substring capture, the
escape sequences that are concerned with captured substrings are not
Since the matching function does not support substring capture, the
escape sequences that are concerned with captured substrings are not
relevant.
RESTARTING AFTER A PARTIAL MATCH
When the alternative matching function has given the PCRE_ERROR_PARTIAL
return, indicating that the subject partially matched the pattern, you
can restart the match with additional subject data by means of the \R
return, indicating that the subject partially matched the pattern, you
can restart the match with additional subject data by means of the \R
escape sequence. For example:
re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
@ -912,30 +923,30 @@ RESTARTING AFTER A PARTIAL MATCH
data> n05\R\D
0: n05
For further information about partial matching, see the pcrepartial
For further information about partial matching, see the pcrepartial
documentation.
CALLOUTS
If the pattern contains any callout requests, pcretest's callout func-
tion is called during matching. This works with both matching func-
If the pattern contains any callout requests, pcretest's callout func-
tion is called during matching. This works with both matching func-
tions. By default, the called function displays the callout number, the
start and current positions in the text at the callout time, and the
start and current positions in the text at the callout time, and the
next pattern item to be tested. For example:
--->pqrabcdef
0 ^ ^ \d
This output indicates that callout number 0 occurred for a match
attempt starting at the fourth character of the subject string, when
This output indicates that callout number 0 occurred for a match
attempt starting at the fourth character of the subject string, when
the pointer was at the seventh character of the data, and when the next
pattern item was \d. Just one circumflex is output if the start and
pattern item was \d. Just one circumflex is output if the start and
current positions are the same.
Callouts numbered 255 are assumed to be automatic callouts, inserted as
a result of the /C pattern modifier. In this case, instead of showing
the callout number, the offset in the pattern, preceded by a plus, is
a result of the /C pattern modifier. In this case, instead of showing
the callout number, the offset in the pattern, preceded by a plus, is
output. For example:
re> /\d?[A-E]\*/C
@ -948,7 +959,7 @@ CALLOUTS
0: E*
If a pattern contains (*MARK) items, an additional line is output when-
ever a change of latest mark is passed to the callout function. For
ever a change of latest mark is passed to the callout function. For
example:
re> /a(*MARK:X)bc/C
@ -962,104 +973,104 @@ CALLOUTS
+12 ^ ^
0: abc
The mark changes between matching "a" and "b", but stays the same for
the rest of the match, so nothing more is output. If, as a result of
backtracking, the mark reverts to being unset, the text "<unset>" is
The mark changes between matching "a" and "b", but stays the same for
the rest of the match, so nothing more is output. If, as a result of
backtracking, the mark reverts to being unset, the text "<unset>" is
output.
The callout function in pcretest returns zero (carry on matching) by
default, but you can use a \C item in a data line (as described above)
The callout function in pcretest returns zero (carry on matching) by
default, but you can use a \C item in a data line (as described above)
to change this and other parameters of the callout.
Inserting callouts can be helpful when using pcretest to check compli-
cated regular expressions. For further information about callouts, see
Inserting callouts can be helpful when using pcretest to check compli-
cated regular expressions. For further information about callouts, see
the pcrecallout documentation.
NON-PRINTING CHARACTERS
When pcretest is outputting text in the compiled version of a pattern,
bytes other than 32-126 are always treated as non-printing characters
When pcretest is outputting text in the compiled version of a pattern,
bytes other than 32-126 are always treated as non-printing characters
are are therefore shown as hex escapes.
When pcretest is outputting text that is a matched part of a subject
string, it behaves in the same way, unless a different locale has been
set for the pattern (using the /L modifier). In this case, the
When pcretest is outputting text that is a matched part of a subject
string, it behaves in the same way, unless a different locale has been
set for the pattern (using the /L modifier). In this case, the
isprint() function to distinguish printing and non-printing characters.
SAVING AND RELOADING COMPILED PATTERNS
The facilities described in this section are not available when the
POSIX interface to PCRE is being used, that is, when the /P pattern
The facilities described in this section are not available when the
POSIX interface to PCRE is being used, that is, when the /P pattern
modifier is specified.
When the POSIX interface is not in use, you can cause pcretest to write
a compiled pattern to a file, by following the modifiers with > and a
a compiled pattern to a file, by following the modifiers with > and a
file name. For example:
/pattern/im >/some/file
See the pcreprecompile documentation for a discussion about saving and
re-using compiled patterns. Note that if the pattern was successfully
See the pcreprecompile documentation for a discussion about saving and
re-using compiled patterns. Note that if the pattern was successfully
studied with JIT optimization, the JIT data cannot be saved.
The data that is written is binary. The first eight bytes are the
length of the compiled pattern data followed by the length of the
optional study data, each written as four bytes in big-endian order
(most significant byte first). If there is no study data (either the
The data that is written is binary. The first eight bytes are the
length of the compiled pattern data followed by the length of the
optional study data, each written as four bytes in big-endian order
(most significant byte first). If there is no study data (either the
pattern was not studied, or studying did not return any data), the sec-
ond length is zero. The lengths are followed by an exact copy of the
compiled pattern. If there is additional study data, this (excluding
any JIT data) follows immediately after the compiled pattern. After
ond length is zero. The lengths are followed by an exact copy of the
compiled pattern. If there is additional study data, this (excluding
any JIT data) follows immediately after the compiled pattern. After
writing the file, pcretest expects to read a new pattern.
A saved pattern can be reloaded into pcretest by specifying < and a
file name instead of a pattern. There must be no space between < and
the file name, which must not contain a < character, as otherwise
pcretest will interpret the line as a pattern delimited by < charac-
A saved pattern can be reloaded into pcretest by specifying < and a
file name instead of a pattern. There must be no space between < and
the file name, which must not contain a < character, as otherwise
pcretest will interpret the line as a pattern delimited by < charac-
ters. For example:
re> </some/file
Compiled pattern loaded from /some/file
No study data
If the pattern was previously studied with the JIT optimization, the
JIT information cannot be saved and restored, and so is lost. When the
pattern has been loaded, pcretest proceeds to read data lines in the
If the pattern was previously studied with the JIT optimization, the
JIT information cannot be saved and restored, and so is lost. When the
pattern has been loaded, pcretest proceeds to read data lines in the
usual way.
You can copy a file written by pcretest to a different host and reload
it there, even if the new host has opposite endianness to the one on
which the pattern was compiled. For example, you can compile on an i86
machine and run on a SPARC machine. When a pattern is reloaded on a
You can copy a file written by pcretest to a different host and reload
it there, even if the new host has opposite endianness to the one on
which the pattern was compiled. For example, you can compile on an i86
machine and run on a SPARC machine. When a pattern is reloaded on a
host with different endianness, the confirmation message is changed to:
Compiled pattern (byte-inverted) loaded from /some/file
The test suite contains some saved pre-compiled patterns with different
endianness. These are reloaded using "<!" instead of just "<". This
endianness. These are reloaded using "<!" instead of just "<". This
suppresses the "(byte-inverted)" text so that the output is the same on
all hosts. It also forces debugging output once the pattern has been
all hosts. It also forces debugging output once the pattern has been
reloaded.
File names for saving and reloading can be absolute or relative, but
note that the shell facility of expanding a file name that starts with
File names for saving and reloading can be absolute or relative, but
note that the shell facility of expanding a file name that starts with
a tilde (~) is not available.
The ability to save and reload files in pcretest is intended for test-
ing and experimentation. It is not intended for production use because
only a single pattern can be written to a file. Furthermore, there is
no facility for supplying custom character tables for use with a
reloaded pattern. If the original pattern was compiled with custom
tables, an attempt to match a subject string using a reloaded pattern
is likely to cause pcretest to crash. Finally, if you attempt to load
The ability to save and reload files in pcretest is intended for test-
ing and experimentation. It is not intended for production use because
only a single pattern can be written to a file. Furthermore, there is
no facility for supplying custom character tables for use with a
reloaded pattern. If the original pattern was compiled with custom
tables, an attempt to match a subject string using a reloaded pattern
is likely to cause pcretest to crash. Finally, if you attempt to load
a file that is not in the correct format, the result is undefined.
SEE ALSO
pcre(3), pcre16(3), pcre32(3), pcreapi(3), pcrecallout(3), pcrejit,
pcre(3), pcre16(3), pcre32(3), pcreapi(3), pcrecallout(3), pcrejit,
pcrematching(3), pcrepartial(d), pcrepattern(3), pcreprecompile(3).
@ -1072,5 +1083,5 @@ AUTHOR
REVISION
Last updated: 12 November 2013
Copyright (c) 1997-2013 University of Cambridge.
Last updated: 09 February 2014
Copyright (c) 1997-2014 University of Cambridge.

57
pcre/maria-patches/pcre_stack_guard.diff

@ -1,57 +0,0 @@
=== modified file 'pcre/pcre.h.in'
--- pcre/pcre.h.in 2013-09-26 14:02:17 +0000
+++ pcre/pcre.h.in 2013-10-02 07:58:29 +0000
@@ -486,6 +486,7 @@ PCRE_EXP_DECL void (*pcre_free)(void *)
PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
PCRE_EXP_DECL void (*pcre_stack_free)(void *);
PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
+PCRE_EXP_DECL int (*pcre_stack_guard)(void);
PCRE_EXP_DECL void *(*pcre16_malloc)(size_t);
PCRE_EXP_DECL void (*pcre16_free)(void *);
@@ -504,6 +505,7 @@ PCRE_EXP_DECL void pcre_free(void *);
PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
PCRE_EXP_DECL void pcre_stack_free(void *);
PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
+PCRE_EXP_DECL int pcre_stack_guard(void);
PCRE_EXP_DECL void *pcre16_malloc(size_t);
PCRE_EXP_DECL void pcre16_free(void *);
=== modified file 'pcre/pcre_compile.c'
--- pcre/pcre_compile.c 2013-09-26 14:02:17 +0000
+++ pcre/pcre_compile.c 2013-10-02 07:58:29 +0000
@@ -7107,6 +7107,12 @@ unsigned int orig_bracount;
unsigned int max_bracount;
branch_chain bc;
+if (pcre_stack_guard && pcre_stack_guard())
+{
+ *errorcodeptr= ERR23;
+ return FALSE;
+}
+
bc.outer = bcptr;
bc.current_branch = code;
=== modified file 'pcre/pcre_globals.c'
--- pcre/pcre_globals.c 2013-09-26 14:02:17 +0000
+++ pcre/pcre_globals.c 2013-10-02 07:58:29 +0000
@@ -72,6 +72,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v
PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = LocalPcreMalloc;
PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = LocalPcreFree;
PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL;
+PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL;
#elif !defined VPCOMPAT
PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = malloc;
@@ -79,6 +80,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v
PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = malloc;
PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = free;
PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL;
+PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL;
#endif
/* End of pcre_globals.c */

6
pcre/pcre.h.in

@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, to be #included by
applications that call the PCRE functions.
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -498,12 +498,14 @@ PCRE_EXP_DECL void (*pcre16_free)(void *);
PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t);
PCRE_EXP_DECL void (*pcre16_stack_free)(void *);
PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *);
PCRE_EXP_DECL int (*pcre16_stack_guard)(void);
PCRE_EXP_DECL void *(*pcre32_malloc)(size_t);
PCRE_EXP_DECL void (*pcre32_free)(void *);
PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t);
PCRE_EXP_DECL void (*pcre32_stack_free)(void *);
PCRE_EXP_DECL int (*pcre32_callout)(pcre32_callout_block *);
PCRE_EXP_DECL int (*pcre32_stack_guard)(void);
#else /* VPCOMPAT */
PCRE_EXP_DECL void *pcre_malloc(size_t);
PCRE_EXP_DECL void pcre_free(void *);
@ -517,12 +519,14 @@ PCRE_EXP_DECL void pcre16_free(void *);
PCRE_EXP_DECL void *pcre16_stack_malloc(size_t);
PCRE_EXP_DECL void pcre16_stack_free(void *);
PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *);
PCRE_EXP_DECL int pcre16_stack_guard(void);
PCRE_EXP_DECL void *pcre32_malloc(size_t);
PCRE_EXP_DECL void pcre32_free(void *);
PCRE_EXP_DECL void *pcre32_stack_malloc(size_t);
PCRE_EXP_DECL void pcre32_stack_free(void *);
PCRE_EXP_DECL int pcre32_callout(pcre32_callout_block *);
PCRE_EXP_DECL int pcre32_stack_guard(void);
#endif /* VPCOMPAT */
/* User defined callback which provides a stack just before the match starts. */

6
pcre/pcre_byte_order.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -311,9 +311,9 @@ while(TRUE)
ptr++;
}
/* Control should never reach here in 16/32 bit mode. */
#endif /* !COMPILE_PCRE8 */
#else /* In 8-bit mode, the pattern does not need to be processed. */
return 0;
#endif /* !COMPILE_PCRE8 */
}
/* End of pcre_byte_order.c */

151
pcre/pcre_compile.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -547,6 +547,8 @@ static const char error_texts[] =
"parentheses are too deeply nested\0"
"invalid range in character class\0"
"group name must start with a non-digit\0"
/* 85 */
"parentheses are too deeply nested (stack check)\0"
;
/* Table to identify digits and hex digits. This is used when compiling
@ -3070,8 +3072,11 @@ const pcre_uint32 *chr_ptr;
const pcre_uint32 *ochr_ptr;
const pcre_uint32 *list_ptr;
const pcre_uchar *next_code;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
const pcre_uchar *xclass_flags;
#endif
const pcre_uint8 *class_bitset;
const pcre_uint32 *set1, *set2, *set_end;
const pcre_uint8 *set1, *set2, *set_end;
pcre_uint32 chr;
BOOL accepted, invert_bits;
@ -3202,12 +3207,12 @@ for(;;)
if (base_list[0] == OP_CLASS)
#endif
{
set1 = (pcre_uint32 *)(base_end - base_list[2]);
set1 = (pcre_uint8 *)(base_end - base_list[2]);
list_ptr = list;
}
else
{
set1 = (pcre_uint32 *)(code - list[2]);
set1 = (pcre_uint8 *)(code - list[2]);
list_ptr = base_list;
}
@ -3216,41 +3221,53 @@ for(;;)
{
case OP_CLASS:
case OP_NCLASS:
set2 = (pcre_uint32 *)
set2 = (pcre_uint8 *)
((list_ptr == list ? code : base_end) - list_ptr[2]);
break;
/* OP_XCLASS cannot be supported here, because its bitset
is not necessarily complete. E.g: [a-\0x{200}] is stored
as a character range, and the appropriate bits are not set. */
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
case OP_XCLASS:
xclass_flags = (list_ptr == list ? code : base_end) - list_ptr[2] + LINK_SIZE;
if ((*xclass_flags & XCL_HASPROP) != 0) return FALSE;
if ((*xclass_flags & XCL_MAP) == 0)
{
/* No bits are set for characters < 256. */
if (list[1] == 0) return TRUE;
/* Might be an empty repeat. */
continue;
}
set2 = (pcre_uint8 *)(xclass_flags + 1);
break;
#endif
case OP_NOT_DIGIT:
invert_bits = TRUE;
/* Fall through */
invert_bits = TRUE;
/* Fall through */
case OP_DIGIT:
set2 = (pcre_uint32 *)(cd->cbits + cbit_digit);
break;
set2 = (pcre_uint8 *)(cd->cbits + cbit_digit);
break;
case OP_NOT_WHITESPACE:
invert_bits = TRUE;
/* Fall through */
invert_bits = TRUE;
/* Fall through */
case OP_WHITESPACE:
set2 = (pcre_uint32 *)(cd->cbits + cbit_space);
break;
set2 = (pcre_uint8 *)(cd->cbits + cbit_space);
break;
case OP_NOT_WORDCHAR:
invert_bits = TRUE;
/* Fall through */
invert_bits = TRUE;
/* Fall through */
case OP_WORDCHAR:
set2 = (pcre_uint32 *)(cd->cbits + cbit_word);
break;
set2 = (pcre_uint8 *)(cd->cbits + cbit_word);
break;
default:
return FALSE;
}
/* Compare 4 bytes to improve speed. */
set_end = set1 + (32 / 4);
/* Because the sets are unaligned, we need
to perform byte comparison here. */
set_end = set1 + 32;
if (invert_bits)
{
do
@ -3551,7 +3568,9 @@ for(;;)
if (list[1] == 0) return TRUE;
}
return FALSE;
/* Control never reaches here. There used to be a fail-save return FALSE; here,
but some compilers complain about an unreachable statement. */
}
@ -3623,7 +3642,7 @@ for (;;)
break;
case OP_MINUPTO:
*code += OP_MINUPTO - OP_UPTO;
*code += OP_POSUPTO - OP_MINUPTO;
break;
}
}
@ -4062,12 +4081,16 @@ for (c = *cptr; c <= d; c++)
if (c > d) return -1; /* Reached end of range */
/* Found a character that has a single other case. Search for the end of the
range, which is either the end of the input range, or a character that has zero
or more than one other cases. */
*ocptr = othercase;
next = othercase + 1;
for (++c; c <= d; c++)
{
if (UCD_OTHERCASE(c) != next) break;
if ((co = UCD_CASESET(c)) != 0 || UCD_OTHERCASE(c) != next) break;
next++;
}
@ -4105,6 +4128,7 @@ add_to_class(pcre_uint8 *classbits, pcre_uchar **uchardptr, int options,
compile_data *cd, pcre_uint32 start, pcre_uint32 end)
{
pcre_uint32 c;
pcre_uint32 classbits_end = (end <= 0xff ? end : 0xff);
int n8 = 0;
/* If caseless matching is required, scan the range and process alternate
@ -4148,7 +4172,7 @@ if ((options & PCRE_CASELESS) != 0)
/* Not UTF-mode, or no UCP */
for (c = start; c <= end && c < 256; c++)
for (c = start; c <= classbits_end; c++)
{
SETBIT(classbits, cd->fcc[c]);
n8++;
@ -4173,22 +4197,21 @@ in all cases. */
#endif /* COMPILE_PCRE[8|16] */
/* If all characters are less than 256, use the bit map. Otherwise use extra
data. */
/* Use the bitmap for characters < 256. Otherwise use extra data.*/
if (end < 0x100)
for (c = start; c <= classbits_end; c++)
{
for (c = start; c <= end; c++)
{
n8++;
SETBIT(classbits, c);
}
/* Regardless of start, c will always be <= 255. */
SETBIT(classbits, c);
n8++;
}
else
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
if (start <= 0xff) start = 0xff + 1;
if (end >= start)
{
pcre_uchar *uchardata = *uchardptr;
#ifdef SUPPORT_UTF
if ((options & PCRE_UTF8) != 0) /* All UTFs use the same flag bit */
{
@ -4228,6 +4251,7 @@ else
*uchardptr = uchardata; /* Updata extra data pointer */
}
#endif /* SUPPORT_UTF || !COMPILE_PCRE8 */
return n8; /* Number of 8-bit characters */
}
@ -4449,6 +4473,9 @@ for (;; ptr++)
BOOL reset_bracount;
int class_has_8bitchar;
int class_one_char;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
BOOL xclass_has_prop;
#endif
int newoptions;
int recno;
int refsign;
@ -4703,12 +4730,6 @@ for (;; ptr++)
goto FAILED;
}
goto NORMAL_CHAR;
/* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
used for "start of word" and "end of word". As these are otherwise illegal
sequences, we don't break anything by recognizing them. They are replaced
by \b(?=\w) and \b(?<=\w) respectively. Sequences like [a[:<:]] are
erroneous and are handled by the normal code below. */
/* In another (POSIX) regex library, the ugly syntax [[:<:]] and [[:>:]] is
used for "start of word" and "end of word". As these are otherwise illegal
@ -4789,13 +4810,26 @@ for (;; ptr++)
should_flip_negation = FALSE;
/* Extended class (xclass) will be used when characters > 255
might match. */
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
xclass = FALSE;
class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */
class_uchardata_base = class_uchardata; /* Save the start */
#endif
/* For optimization purposes, we track some properties of the class:
class_has_8bitchar will be non-zero if the class contains at least one <
256 character; class_one_char will be 1 if the class contains just one
character. */
character; xclass_has_prop will be TRUE if unicode property checks
are present in the class. */
class_has_8bitchar = 0;
class_one_char = 0;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
xclass_has_prop = FALSE;
#endif
/* Initialize the 32-char bit map to all zeros. We build the map in a
temporary bit of memory, in case the class contains fewer than two
@ -4804,12 +4838,6 @@ for (;; ptr++)
memset(classbits, 0, 32 * sizeof(pcre_uint8));
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
xclass = FALSE;
class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */
class_uchardata_base = class_uchardata; /* Save the start */
#endif
/* Process characters until ] is reached. By writing this as a "do" it
means that an initial ] is taken as a data character. At the start of the
loop, c contains the first byte of the character. */
@ -4933,6 +4961,7 @@ for (;; ptr++)
*class_uchardata++ = local_negate? XCL_NOTPROP : XCL_PROP;
*class_uchardata++ = ptype;
*class_uchardata++ = 0;
xclass_has_prop = TRUE;
ptr = tempptr + 1;
continue;
@ -5115,6 +5144,7 @@ for (;; ptr++)
XCL_PROP : XCL_NOTPROP;
*class_uchardata++ = ptype;
*class_uchardata++ = pdata;
xclass_has_prop = TRUE;
class_has_8bitchar--; /* Undo! */
continue;
}
@ -5409,6 +5439,7 @@ for (;; ptr++)
*code++ = OP_XCLASS;
code += LINK_SIZE;
*code = negate_class? XCL_NOT:0;
if (xclass_has_prop) *code |= XCL_HASPROP;
/* If the map is required, move up the extra data to make room for it;
otherwise just move the code pointer to the end of the extra data. */
@ -5418,6 +5449,8 @@ for (;; ptr++)
*code++ |= XCL_MAP;
memmove(code + (32 / sizeof(pcre_uchar)), code,
IN_UCHARS(class_uchardata - code));
if (negate_class && !xclass_has_prop)
for (c = 0; c < 32; c++) classbits[c] = ~classbits[c];
memcpy(code, classbits, 32);
code = class_uchardata + (32 / sizeof(pcre_uchar));
}
@ -6586,7 +6619,10 @@ for (;; ptr++)
code[1+LINK_SIZE] = OP_CREF;
skipbytes = 1+IMM2_SIZE;
refsign = -1;
refsign = -1; /* => not a number */
namelen = -1; /* => not a name; must set to avoid warning */
name = NULL; /* Always set to avoid warning */
recno = 0; /* Always set to avoid warning */
/* Check for a test for recursion in a named group. */
@ -6623,7 +6659,6 @@ for (;; ptr++)
if (refsign >= 0)
{
recno = 0;
while (IS_DIGIT(*ptr))
{
recno = recno * 10 + (int)(*ptr - CHAR_0);
@ -8000,12 +8035,16 @@ unsigned int orig_bracount;
unsigned int max_bracount;
branch_chain bc;
if (pcre_stack_guard && pcre_stack_guard())
{
*errorcodeptr= ERR23;
/* If set, call the external function that checks for stack availability. */
if (PUBL(stack_guard) != NULL && PUBL(stack_guard)())
{
*errorcodeptr= ERR85;
return FALSE;
}
}
/* Miscellaneous initialization */
bc.outer = bcptr;
bc.current_branch = code;

69
pcre/pcre_dfa_exec.c

@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language (but see
below for why this module is different).
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -1473,7 +1473,7 @@ for (;;)
goto ANYNL01;
case CHAR_CR:
if (ptr + 1 < end_subject && RAWUCHARTEST(ptr + 1) == CHAR_LF) ncount = 1;
if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
/* Fall through */
ANYNL01:
@ -1742,7 +1742,7 @@ for (;;)
goto ANYNL02;
case CHAR_CR:
if (ptr + 1 < end_subject && RAWUCHARTEST(ptr + 1) == CHAR_LF) ncount = 1;
if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
/* Fall through */
ANYNL02:
@ -2012,7 +2012,7 @@ for (;;)
goto ANYNL03;
case CHAR_CR:
if (ptr + 1 < end_subject && RAWUCHARTEST(ptr + 1) == CHAR_LF) ncount = 1;
if (ptr + 1 < end_subject && UCHAR21TEST(ptr + 1) == CHAR_LF) ncount = 1;
/* Fall through */
ANYNL03:
@ -2210,7 +2210,7 @@ for (;;)
if ((md->moptions & PCRE_PARTIAL_HARD) != 0)
reset_could_continue = TRUE;
}
else if (RAWUCHARTEST(ptr + 1) == CHAR_LF)
else if (UCHAR21TEST(ptr + 1) == CHAR_LF)
{
ADD_NEW_DATA(-(state_offset + 1), 0, 1);
}
@ -3466,7 +3466,7 @@ for (;;)
if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0)
{
/* Advance to a known first char. */
/* Advance to a known first pcre_uchar (i.e. data item) */
if (has_first_char)
{
@ -3474,12 +3474,12 @@ for (;;)
{
pcre_uchar csc;
while (current_subject < end_subject &&
(csc = RAWUCHARTEST(current_subject)) != first_char && csc != first_char2)
(csc = UCHAR21TEST(current_subject)) != first_char && csc != first_char2)
current_subject++;
}
else
while (current_subject < end_subject &&
RAWUCHARTEST(current_subject) != first_char)
UCHAR21TEST(current_subject) != first_char)
current_subject++;
}
@ -3509,36 +3509,26 @@ for (;;)
ANYCRLF, and we are now at a LF, advance the match position by one
more character. */
if (RAWUCHARTEST(current_subject - 1) == CHAR_CR &&
if (UCHAR21TEST(current_subject - 1) == CHAR_CR &&
(md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
current_subject < end_subject &&
RAWUCHARTEST(current_subject) == CHAR_NL)
UCHAR21TEST(current_subject) == CHAR_NL)
current_subject++;
}
}
/* Or to a non-unique first char after study */
/* Advance to a non-unique first pcre_uchar after study */
else if (start_bits != NULL)
{
while (current_subject < end_subject)
{
register pcre_uint32 c = RAWUCHARTEST(current_subject);
register pcre_uint32 c = UCHAR21TEST(current_subject);
#ifndef COMPILE_PCRE8
if (c > 255) c = 255;
#endif
if ((start_bits[c/8] & (1 << (c&7))) == 0)
{
current_subject++;
#if defined SUPPORT_UTF && defined COMPILE_PCRE8
/* In non 8-bit mode, the iteration will stop for
characters > 255 at the beginning or not stop at all. */
if (utf)
ACROSSCHAR(current_subject < end_subject, *current_subject,
current_subject++);
#endif
}
else break;
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
current_subject++;
}
}
}
@ -3557,19 +3547,20 @@ for (;;)
/* If the pattern was studied, a minimum subject length may be set. This
is a lower bound; no actual string of that length may actually match the
pattern. Although the value is, strictly, in characters, we treat it as
bytes to avoid spending too much time in this optimization. */
in pcre_uchar units to avoid spending too much time in this optimization.
*/
if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 &&
(pcre_uint32)(end_subject - current_subject) < study->minlength)
return PCRE_ERROR_NOMATCH;
/* If req_char is set, we know that that character must appear in the
subject for the match to succeed. If the first character is set, req_char
must be later in the subject; otherwise the test starts at the match
point. This optimization can save a huge amount of work in patterns with
nested unlimited repeats that aren't going to match. Writing separate
code for cased/caseless versions makes it go faster, as does using an
autoincrement and backing off on a match.
/* If req_char is set, we know that that pcre_uchar must appear in the
subject for the match to succeed. If the first pcre_uchar is set,
req_char must be later in the subject; otherwise the test starts at the
match point. This optimization can save a huge amount of work in patterns
with nested unlimited repeats that aren't going to match. Writing
separate code for cased/caseless versions makes it go faster, as does
using an autoincrement and backing off on a match.
HOWEVER: when the subject string is very, very long, searching to its end
can take a long time, and give bad performance on quite ordinary
@ -3589,7 +3580,7 @@ for (;;)
{
while (p < end_subject)
{
register pcre_uint32 pp = RAWUCHARINCTEST(p);
register pcre_uint32 pp = UCHAR21INCTEST(p);
if (pp == req_char || pp == req_char2) { p--; break; }
}
}
@ -3597,18 +3588,18 @@ for (;;)
{
while (p < end_subject)
{
if (RAWUCHARINCTEST(p) == req_char) { p--; break; }
if (UCHAR21INCTEST(p) == req_char) { p--; break; }
}
}
/* If we can't find the required character, break the matching loop,
/* If we can't find the required pcre_uchar, break the matching loop,
which will cause a return or PCRE_ERROR_NOMATCH. */
if (p >= end_subject) break;
/* If we have found the required character, save the point where we
/* If we have found the required pcre_uchar, save the point where we
found it, so that we don't search again next time round the loop if
the start hasn't passed this character yet. */
the start hasn't passed this point yet. */
req_char_ptr = p;
}
@ -3665,9 +3656,9 @@ for (;;)
not contain any explicit matches for \r or \n, and the newline option is CRLF
or ANY or ANYCRLF, advance the match position by one more character. */
if (RAWUCHARTEST(current_subject - 1) == CHAR_CR &&
if (UCHAR21TEST(current_subject - 1) == CHAR_CR &&
current_subject < end_subject &&
RAWUCHARTEST(current_subject) == CHAR_NL &&
UCHAR21TEST(current_subject) == CHAR_NL &&
(re->flags & PCRE_HASCRORLF) == 0 &&
(md->nltype == NLTYPE_ANY ||
md->nltype == NLTYPE_ANYCRLF ||

102
pcre/pcre_exec.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -134,7 +134,7 @@ pcre_uint32 c;
BOOL utf = md->utf;
if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
while (length-- > 0)
if (isprint(c = RAWUCHARINCTEST(p))) printf("%c", (char)c); else printf("\\x{%02x}", c);
if (isprint(c = UCHAR21INCTEST(p))) printf("%c", (char)c); else printf("\\x{%02x}", c);
}
#endif
@ -237,8 +237,8 @@ if (caseless)
{
pcre_uint32 cc, cp;
if (eptr >= md->end_subject) return -2; /* Partial match */
cc = RAWUCHARTEST(eptr);
cp = RAWUCHARTEST(p);
cc = UCHAR21TEST(eptr);
cp = UCHAR21TEST(p);
if (TABLE_GET(cp, md->lcc, cp) != TABLE_GET(cc, md->lcc, cc)) return -1;
p++;
eptr++;
@ -254,7 +254,7 @@ else
while (length-- > 0)
{
if (eptr >= md->end_subject) return -2; /* Partial match */
if (RAWUCHARINCTEST(p) != RAWUCHARINCTEST(eptr)) return -1;
if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1;
}
}
@ -2103,7 +2103,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHARTEST(eptr) == NLBLOCK->nl[0])
UCHAR21TEST(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -2147,7 +2147,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHARTEST(eptr) == NLBLOCK->nl[0])
UCHAR21TEST(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -2290,7 +2290,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHARTEST(eptr) == NLBLOCK->nl[0])
UCHAR21TEST(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -2444,7 +2444,7 @@ for (;;)
{
SCHECK_PARTIAL();
}
else if (RAWUCHARTEST(eptr) == CHAR_LF) eptr++;
else if (UCHAR21TEST(eptr) == CHAR_LF) eptr++;
break;
case CHAR_LF:
@ -2691,16 +2691,22 @@ for (;;)
pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
ecode += 1 + 2*IMM2_SIZE;
/* Setting the default length first and initializing 'offset' avoids
compiler warnings in the REF_REPEAT code. */
length = (md->jscript_compat)? 0 : -1;
offset = 0;
while (count-- > 0)
{
offset = GET2(slot, 0) << 1;
if (offset < offset_top && md->offset_vector[offset] >= 0) break;
if (offset < offset_top && md->offset_vector[offset] >= 0)
{
length = md->offset_vector[offset+1] - md->offset_vector[offset];
break;
}
slot += md->name_entry_size;
}
if (count < 0)
length = (md->jscript_compat)? 0 : -1;
else
length = md->offset_vector[offset+1] - md->offset_vector[offset];
}
goto REF_REPEAT;
@ -3212,7 +3218,7 @@ for (;;)
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */
RRETURN(MATCH_NOMATCH);
}
while (length-- > 0) if (*ecode++ != RAWUCHARINC(eptr)) RRETURN(MATCH_NOMATCH);
while (length-- > 0) if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
}
else
#endif
@ -3252,7 +3258,7 @@ for (;;)
if (fc < 128)
{
pcre_uint32 cc = RAWUCHAR(eptr);
pcre_uint32 cc = UCHAR21(eptr);
if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);
ecode++;
eptr++;
@ -3521,7 +3527,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHARTEST(eptr);
cc = UCHAR21TEST(eptr);
if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
eptr++;
}
@ -3539,7 +3545,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHARTEST(eptr);
cc = UCHAR21TEST(eptr);
if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
eptr++;
}
@ -3556,7 +3562,7 @@ for (;;)
SCHECK_PARTIAL();
break;
}
cc = RAWUCHARTEST(eptr);
cc = UCHAR21TEST(eptr);
if (fc != cc && foc != cc) break;
eptr++;
}
@ -3583,7 +3589,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
if (fc != RAWUCHARINCTEST(eptr)) RRETURN(MATCH_NOMATCH);
if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
}
if (min == max) continue;
@ -3600,7 +3606,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
if (fc != RAWUCHARINCTEST(eptr)) RRETURN(MATCH_NOMATCH);
if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
}
/* Control never gets here */
}
@ -3614,7 +3620,7 @@ for (;;)
SCHECK_PARTIAL();
break;
}
if (fc != RAWUCHARTEST(eptr)) break;
if (fc != UCHAR21TEST(eptr)) break;
eptr++;
}
if (possessive) continue; /* No backtracking */
@ -4369,7 +4375,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHAR(eptr) == NLBLOCK->nl[0])
UCHAR21(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -4411,7 +4417,7 @@ for (;;)
default: RRETURN(MATCH_NOMATCH);
case CHAR_CR:
if (eptr < md->end_subject && RAWUCHAR(eptr) == CHAR_LF) eptr++;
if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
break;
case CHAR_LF:
@ -4521,7 +4527,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHAR(eptr);
cc = UCHAR21(eptr);
if (cc >= 128 || (md->ctypes[cc] & ctype_digit) == 0)
RRETURN(MATCH_NOMATCH);
eptr++;
@ -4538,7 +4544,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHAR(eptr);
cc = UCHAR21(eptr);
if (cc < 128 && (md->ctypes[cc] & ctype_space) != 0)
RRETURN(MATCH_NOMATCH);
eptr++;
@ -4555,7 +4561,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHAR(eptr);
cc = UCHAR21(eptr);
if (cc >= 128 || (md->ctypes[cc] & ctype_space) == 0)
RRETURN(MATCH_NOMATCH);
eptr++;
@ -4572,7 +4578,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHAR(eptr);
cc = UCHAR21(eptr);
if (cc < 128 && (md->ctypes[cc] & ctype_word) != 0)
RRETURN(MATCH_NOMATCH);
eptr++;
@ -4589,7 +4595,7 @@ for (;;)
SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH);
}
cc = RAWUCHAR(eptr);
cc = UCHAR21(eptr);
if (cc >= 128 || (md->ctypes[cc] & ctype_word) == 0)
RRETURN(MATCH_NOMATCH);
eptr++;
@ -5150,7 +5156,7 @@ for (;;)
{
default: RRETURN(MATCH_NOMATCH);
case CHAR_CR:
if (eptr < md->end_subject && RAWUCHAR(eptr) == CHAR_LF) eptr++;
if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
break;
case CHAR_LF:
@ -5689,7 +5695,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHAR(eptr) == NLBLOCK->nl[0])
UCHAR21(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -5715,7 +5721,7 @@ for (;;)
eptr + 1 >= md->end_subject &&
NLBLOCK->nltype == NLTYPE_FIXED &&
NLBLOCK->nllen == 2 &&
RAWUCHAR(eptr) == NLBLOCK->nl[0])
UCHAR21(eptr) == NLBLOCK->nl[0])
{
md->hitend = TRUE;
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
@ -5772,7 +5778,7 @@ for (;;)
if (c == CHAR_CR)
{
if (++eptr >= md->end_subject) break;
if (RAWUCHAR(eptr) == CHAR_LF) eptr++;
if (UCHAR21(eptr) == CHAR_LF) eptr++;
}
else
{
@ -5935,8 +5941,8 @@ for (;;)
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
eptr--;
BACKCHAR(eptr);
if (ctype == OP_ANYNL && eptr > pp && RAWUCHAR(eptr) == CHAR_NL &&
RAWUCHAR(eptr - 1) == CHAR_CR) eptr--;
if (ctype == OP_ANYNL && eptr > pp && UCHAR21(eptr) == CHAR_NL &&
UCHAR21(eptr - 1) == CHAR_CR) eptr--;
}
}
else
@ -6783,10 +6789,10 @@ for(;;)
if (first_char != first_char2)
while (start_match < end_subject &&
(smc = RAWUCHARTEST(start_match)) != first_char && smc != first_char2)
(smc = UCHAR21TEST(start_match)) != first_char && smc != first_char2)
start_match++;
else
while (start_match < end_subject && RAWUCHARTEST(start_match) != first_char)
while (start_match < end_subject && UCHAR21TEST(start_match) != first_char)
start_match++;
}
@ -6818,7 +6824,7 @@ for(;;)
if (start_match[-1] == CHAR_CR &&
(md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
start_match < end_subject &&
RAWUCHARTEST(start_match) == CHAR_NL)
UCHAR21TEST(start_match) == CHAR_NL)
start_match++;
}
}
@ -6829,22 +6835,12 @@ for(;;)
{
while (start_match < end_subject)
{
register pcre_uint32 c = RAWUCHARTEST(start_match);
register pcre_uint32 c = UCHAR21TEST(start_match);
#ifndef COMPILE_PCRE8
if (c > 255) c = 255;
#endif
if ((start_bits[c/8] & (1 << (c&7))) == 0)
{
start_match++;
#if defined SUPPORT_UTF && defined COMPILE_PCRE8
/* In non 8-bit mode, the iteration will stop for
characters > 255 at the beginning or not stop at all. */
if (utf)
ACROSSCHAR(start_match < end_subject, *start_match,
start_match++);
#endif
}
else break;
if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
start_match++;
}
}
} /* Starting optimizations */
@ -6897,7 +6893,7 @@ for(;;)
{
while (p < end_subject)
{
register pcre_uint32 pp = RAWUCHARINCTEST(p);
register pcre_uint32 pp = UCHAR21INCTEST(p);
if (pp == req_char || pp == req_char2) { p--; break; }
}
}
@ -6905,7 +6901,7 @@ for(;;)
{
while (p < end_subject)
{
if (RAWUCHARINCTEST(p) == req_char) { p--; break; }
if (UCHAR21INCTEST(p) == req_char) { p--; break; }
}
}

2
pcre/pcre_globals.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2012 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without

118
pcre/pcre_internal.h

@ -7,7 +7,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -316,8 +316,8 @@ start/end of string field names are. */
&(NLBLOCK->nllen), utf)) \
: \
((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \
RAWUCHARTEST(p) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || RAWUCHARTEST(p+1) == NLBLOCK->nl[1]) \
UCHAR21TEST(p) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || UCHAR21TEST(p+1) == NLBLOCK->nl[1]) \
) \
)
@ -330,8 +330,8 @@ start/end of string field names are. */
&(NLBLOCK->nllen), utf)) \
: \
((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \
RAWUCHARTEST(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || RAWUCHARTEST(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \
UCHAR21TEST(p - NLBLOCK->nllen) == NLBLOCK->nl[0] && \
(NLBLOCK->nllen == 1 || UCHAR21TEST(p - NLBLOCK->nllen + 1) == NLBLOCK->nl[1]) \
) \
)
@ -582,12 +582,27 @@ changed in future to be a fixed number of bytes or to depend on LINK_SIZE. */
#define MAX_MARK ((1u << 8) - 1)
#endif
/* There is a proposed future special "UTF-21" mode, in which only the lowest
21 bits of a 32-bit character are interpreted as UTF, with the remaining 11
high-order bits available to the application for other uses. In preparation for
the future implementation of this mode, there are macros that load a data item
and, if in this special mode, mask it to 21 bits. These macros all have names
starting with UCHAR21. In all other modes, including the normal 32-bit
library, the macros all have the same simple definitions. When the new mode is
implemented, it is expected that these definitions will be varied appropriately
using #ifdef when compiling the library that supports the special mode. */
#define UCHAR21(eptr) (*(eptr))
#define UCHAR21TEST(eptr) (*(eptr))
#define UCHAR21INC(eptr) (*(eptr)++)
#define UCHAR21INCTEST(eptr) (*(eptr)++)
/* When UTF encoding is being used, a character is no longer just a single
byte. The macros for character handling generate simple sequences when used in
character-mode, and more complicated ones for UTF characters. GETCHARLENTEST
and other macros are not used when UTF is not supported, so they are not
defined. To make sure they can never even appear when UTF support is omitted,
we don't even define them. */
byte in 8-bit mode or a single short in 16-bit mode. The macros for character
handling generate simple sequences when used in the basic mode, and more
complicated ones for UTF characters. GETCHARLENTEST and other macros are not
used when UTF is not supported. To make sure they can never even appear when
UTF support is omitted, we don't even define them. */
#ifndef SUPPORT_UTF
@ -600,10 +615,6 @@ we don't even define them. */
#define GETCHARINC(c, eptr) c = *eptr++;
#define GETCHARINCTEST(c, eptr) c = *eptr++;
#define GETCHARLEN(c, eptr, len) c = *eptr;
#define RAWUCHAR(eptr) (*(eptr))
#define RAWUCHARINC(eptr) (*(eptr)++)
#define RAWUCHARTEST(eptr) (*(eptr))
#define RAWUCHARINCTEST(eptr) (*(eptr)++)
/* #define GETCHARLENTEST(c, eptr, len) */
/* #define BACKCHAR(eptr) */
/* #define FORWARDCHAR(eptr) */
@ -776,30 +787,6 @@ do not know if we are in UTF-8 mode. */
c = *eptr; \
if (utf && c >= 0xc0) GETUTF8LEN(c, eptr, len);
/* Returns the next uchar, not advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHAR(eptr) \
(*(eptr))
/* Returns the next uchar, advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHARINC(eptr) \
(*((eptr)++))
/* Returns the next uchar, testing for UTF mode, and not advancing the
pointer. */
#define RAWUCHARTEST(eptr) \
(*(eptr))
/* Returns the next uchar, testing for UTF mode, advancing the
pointer. */
#define RAWUCHARINCTEST(eptr) \
(*((eptr)++))
/* If the pointer is not at the start of a character, move it back until
it is. This is called only in UTF-8 mode - we don't put a test within the macro
because almost all calls are already within a block of UTF-8 only code. */
@ -895,30 +882,6 @@ we do not know if we are in UTF-16 mode. */
c = *eptr; \
if (utf && (c & 0xfc00) == 0xd800) GETUTF16LEN(c, eptr, len);
/* Returns the next uchar, not advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHAR(eptr) \
(*(eptr))
/* Returns the next uchar, advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHARINC(eptr) \
(*((eptr)++))
/* Returns the next uchar, testing for UTF mode, and not advancing the
pointer. */
#define RAWUCHARTEST(eptr) \
(*(eptr))
/* Returns the next uchar, testing for UTF mode, advancing the
pointer. */
#define RAWUCHARINCTEST(eptr) \
(*((eptr)++))
/* If the pointer is not at the start of a character, move it back until
it is. This is called only in UTF-16 mode - we don't put a test within the
macro because almost all calls are already within a block of UTF-16 only
@ -980,30 +943,6 @@ This is called when we do not know if we are in UTF-32 mode. */
#define GETCHARLENTEST(c, eptr, len) \
GETCHARTEST(c, eptr)
/* Returns the next uchar, not advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHAR(eptr) \
(*(eptr))
/* Returns the next uchar, advancing the pointer. This is called when
we know we are in UTF mode. */
#define RAWUCHARINC(eptr) \
(*((eptr)++))
/* Returns the next uchar, testing for UTF mode, and not advancing the
pointer. */
#define RAWUCHARTEST(eptr) \
(*(eptr))
/* Returns the next uchar, testing for UTF mode, advancing the
pointer. */
#define RAWUCHARINCTEST(eptr) \
(*((eptr)++))
/* If the pointer is not at the start of a character, move it back until
it is. This is called only in UTF-32 mode - we don't put a test within the
macro because almost all calls are already within a block of UTF-32 only
@ -1874,8 +1813,9 @@ table. */
/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
contain characters with values greater than 255. */
#define XCL_NOT 0x01 /* Flag: this is a negative class */
#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */
#define XCL_NOT 0x01 /* Flag: this is a negative class */
#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */
#define XCL_HASPROP 0x04 /* Flag: property checks are present. */
#define XCL_END 0 /* Marks end of individual items */
#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */
@ -2341,7 +2281,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,
ERR80, ERR81, ERR82, ERR83, ERR84, ERRCOUNT };
ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERRCOUNT };
/* JIT compiling modes. The function list is indexed by them. */

1931
pcre/pcre_jit_compile.c
File diff suppressed because it is too large
View File

72
pcre/pcre_jit_test.c

@ -75,9 +75,14 @@ POSSIBILITY OF SUCH DAMAGE.
\xe1\xbf\xb8 = 0x1ff8 = 8184
\xf0\x90\x90\x80 = 0x10400 = 66560
\xf0\x90\x90\xa8 = 0x10428 = 66600
\xc7\x84 = 0x1c4 = 452
\xc7\x85 = 0x1c5 = 453
\xc7\x86 = 0x1c6 = 454
Mark property:
\xcc\x8d = 0x30d = 781
Special:
\xc2\x80 = 0x80 = 128 (lowest 2 byte character)
\xdf\xbf = 0x7ff = 2047 (highest 2 byte character)
\xe0\xa0\x80 = 0x800 = 2048 (lowest 2 byte character)
\xef\xbf\xbf = 0xffff = 65535 (highest 3 byte character)
@ -326,6 +331,22 @@ static struct regression_test_case regression_test_cases[] = {
{ MUA, 0, "\\w(\\s|(?:\\d)*,)+\\w\\wb", "a 5, 4,, bb 5, 4,, aab" },
{ MUA, 0, "(\\v+)(\\V+)", "\x0e\xc2\x85\xe2\x80\xa8\x0b\x09\xe2\x80\xa9" },
{ MUA, 0, "(\\h+)(\\H+)", "\xe2\x80\xa8\xe2\x80\x80\x20\xe2\x80\x8a\xe2\x81\x9f\xe3\x80\x80\x09\x20\xc2\xa0\x0a" },
{ MUA, 0, "x[bcef]+", "xaxdxecbfg" },
{ MUA, 0, "x[bcdghij]+", "xaxexfxdgbjk" },
{ MUA, 0, "x[^befg]+", "xbxexacdhg" },
{ MUA, 0, "x[^bcdl]+", "xlxbxaekmd" },
{ MUA, 0, "x[^bcdghi]+", "xbxdxgxaefji" },
{ MUA, 0, "x[B-Fb-f]+", "xaxAxgxbfBFG" },
{ CMUA, 0, "\\x{e9}+", "#\xf0\x90\x90\xa8\xc3\xa8\xc3\xa9\xc3\x89\xc3\x88" },
{ CMUA, 0, "[^\\x{e9}]+", "\xc3\xa9#\xf0\x90\x90\xa8\xc3\xa8\xc3\x88\xc3\x89" },
{ MUA, 0, "[\\x02\\x7e]+", "\xc3\x81\xe1\xbf\xb8\xf0\x90\x90\xa8\x01\x02\x7e\x7f" },
{ MUA, 0, "[^\\x02\\x7e]+", "\x02\xc3\x81\xe1\xbf\xb8\xf0\x90\x90\xa8\x01\x7f\x7e" },
{ MUA, 0, "[\\x{81}-\\x{7fe}]+", "#\xe1\xbf\xb8\xf0\x90\x90\xa8\xc2\x80\xc2\x81\xdf\xbe\xdf\xbf" },
{ MUA, 0, "[^\\x{81}-\\x{7fe}]+", "\xc2\x81#\xe1\xbf\xb8\xf0\x90\x90\xa8\xc2\x80\xdf\xbf\xdf\xbe" },
{ MUA, 0, "[\\x{801}-\\x{fffe}]+", "#\xc3\xa9\xf0\x90\x90\x80\xe0\xa0\x80\xe0\xa0\x81\xef\xbf\xbe\xef\xbf\xbf" },
{ MUA, 0, "[^\\x{801}-\\x{fffe}]+", "\xe0\xa0\x81#\xc3\xa9\xf0\x90\x90\x80\xe0\xa0\x80\xef\xbf\xbf\xef\xbf\xbe" },
{ MUA, 0, "[\\x{10001}-\\x{10fffe}]+", "#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf0\x90\x80\x81\xf4\x8f\xbf\xbe\xf4\x8f\xbf\xbf" },
{ MUA, 0, "[^\\x{10001}-\\x{10fffe}]+", "\xf0\x90\x80\x81#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbe" },
/* Unicode properties. */
{ MUAP, 0, "[1-5\xc3\xa9\\w]", "\xc3\xa1_" },
@ -371,6 +392,10 @@ static struct regression_test_case regression_test_cases[] = {
{ PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },
{ PCRE_MULTILINE | PCRE_NEWLINE_CR, 0, "\\W{0,2}[^#]{3}", "\r\n#....." },
{ PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 0, "\\W{1,3}[^#]", "\r\n##...." },
{ MUA | PCRE_NO_UTF8_CHECK, 1, "^.a", "\n\x80\nxa" },
{ MUA, 1, "^", "\r\n" },
{ PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 1 | F_NOMATCH, "^", "\r\n" },
{ PCRE_MULTILINE | PCRE_NEWLINE_CRLF, 1, "^", "\r\na" },
/* Any character except newline or any newline. */
{ PCRE_NEWLINE_CRLF, 0, ".", "\r" },
@ -629,6 +654,7 @@ static struct regression_test_case regression_test_cases[] = {
{ PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 0 | F_NOMATCH | F_PROPERTY, "\\p{Any}{4}|a", "\r\na" },
{ PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" },
{ PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" },
{ MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" },
/* Recurse. */
{ MUA, 0, "(a)(?1)", "aa" },
@ -959,7 +985,7 @@ static int convert_utf8_to_utf16(const char *input, PCRE_UCHAR16 *output, int *o
if (offsetmap)
*offsetmap++ = (int)(iptr - (unsigned char*)input);
if (!(*iptr & 0x80))
if (*iptr < 0xc0)
c = *iptr++;
else if (!(*iptr & 0x20)) {
c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);
@ -1031,7 +1057,7 @@ static int convert_utf8_to_utf32(const char *input, PCRE_UCHAR32 *output, int *o
if (offsetmap)
*offsetmap++ = (int)(iptr - (unsigned char*)input);
if (!(*iptr & 0x80))
if (*iptr < 0xc0)
c = *iptr++;
else if (!(*iptr & 0x20)) {
c = ((iptr[0] & 0x1f) << 6) | (iptr[1] & 0x3f);
@ -1092,7 +1118,7 @@ static int regression_tests(void)
const char *error;
char *cpu_info;
int i, err_offs;
int is_successful, is_ascii_pattern, is_ascii_input;
int is_successful, is_ascii;
int total = 0;
int successful = 0;
int successful_row = 0;
@ -1173,13 +1199,9 @@ static int regression_tests(void)
while (current->pattern) {
/* printf("\nPattern: %s :\n", current->pattern); */
total++;
if (current->start_offset & F_PROPERTY) {
is_ascii_pattern = 0;
is_ascii_input = 0;
} else {
is_ascii_pattern = check_ascii(current->pattern);
is_ascii_input = check_ascii(current->input);
}
is_ascii = 0;
if (!(current->start_offset & F_PROPERTY))
is_ascii = check_ascii(current->pattern) && check_ascii(current->input);
if (current->flags & PCRE_PARTIAL_SOFT)
study_mode = PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE;
@ -1211,7 +1233,7 @@ static int regression_tests(void)
re8 = NULL;
}
extra8->flags |= PCRE_EXTRA_MARK;
} else if (((utf && ucp) || is_ascii_pattern) && !(current->start_offset & F_NO8))
} else if (((utf && ucp) || is_ascii) && !(current->start_offset & F_NO8))
printf("\n8 bit: Cannot compile pattern \"%s\": %s\n", current->pattern, error);
#endif
#ifdef SUPPORT_PCRE16
@ -1242,7 +1264,7 @@ static int regression_tests(void)
re16 = NULL;
}
extra16->flags |= PCRE_EXTRA_MARK;
} else if (((utf && ucp) || is_ascii_pattern) && !(current->start_offset & F_NO16))
} else if (((utf && ucp) || is_ascii) && !(current->start_offset & F_NO16))
printf("\n16 bit: Cannot compile pattern \"%s\": %s\n", current->pattern, error);
#endif
#ifdef SUPPORT_PCRE32
@ -1273,7 +1295,7 @@ static int regression_tests(void)
re32 = NULL;
}
extra32->flags |= PCRE_EXTRA_MARK;
} else if (((utf && ucp) || is_ascii_pattern) && !(current->start_offset & F_NO32))
} else if (((utf && ucp) || is_ascii) && !(current->start_offset & F_NO32))
printf("\n32 bit: Cannot compile pattern \"%s\": %s\n", current->pattern, error);
#endif
@ -1305,10 +1327,10 @@ static int regression_tests(void)
if ((counter & 0x1) != 0) {
setstack8(extra8);
return_value8[0] = pcre_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_1, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_1, 32);
} else
return_value8[0] = pcre_jit_exec(re8, extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_1, 32, getstack8());
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_1, 32, getstack8());
memset(&dummy_extra8, 0, sizeof(pcre_extra));
dummy_extra8.flags = PCRE_EXTRA_MARK;
if (current->start_offset & F_STUDY) {
@ -1317,7 +1339,7 @@ static int regression_tests(void)
}
dummy_extra8.mark = &mark8_2;
return_value8[1] = pcre_exec(re8, &dummy_extra8, current->input, strlen(current->input), current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector8_2, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector8_2, 32);
}
#endif
@ -1339,10 +1361,10 @@ static int regression_tests(void)
if ((counter & 0x1) != 0) {
setstack16(extra16);
return_value16[0] = pcre16_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_1, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_1, 32);
} else
return_value16[0] = pcre16_jit_exec(re16, extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_1, 32, getstack16());
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_1, 32, getstack16());
memset(&dummy_extra16, 0, sizeof(pcre16_extra));
dummy_extra16.flags = PCRE_EXTRA_MARK;
if (current->start_offset & F_STUDY) {
@ -1351,7 +1373,7 @@ static int regression_tests(void)
}
dummy_extra16.mark = &mark16_2;
return_value16[1] = pcre16_exec(re16, &dummy_extra16, regtest_buf16, length16, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector16_2, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector16_2, 32);
}
#endif
@ -1373,10 +1395,10 @@ static int regression_tests(void)
if ((counter & 0x1) != 0) {
setstack32(extra32);
return_value32[0] = pcre32_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_1, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_1, 32);
} else
return_value32[0] = pcre32_jit_exec(re32, extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_1, 32, getstack32());
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_1, 32, getstack32());
memset(&dummy_extra32, 0, sizeof(pcre32_extra));
dummy_extra32.flags = PCRE_EXTRA_MARK;
if (current->start_offset & F_STUDY) {
@ -1385,7 +1407,7 @@ static int regression_tests(void)
}
dummy_extra32.mark = &mark32_2;
return_value32[1] = pcre32_exec(re32, &dummy_extra32, regtest_buf32, length32, current->start_offset & OFFSET_MASK,
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD), ovector32_2, 32);
current->flags & (PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | PCRE_PARTIAL_SOFT | PCRE_PARTIAL_HARD | PCRE_NO_UTF8_CHECK), ovector32_2, 32);
}
#endif
@ -1581,7 +1603,7 @@ static int regression_tests(void)
if (is_successful) {
#ifdef SUPPORT_PCRE8
if (!(current->start_offset & F_NO8) && ((utf && ucp) || is_ascii_input)) {
if (!(current->start_offset & F_NO8) && ((utf && ucp) || is_ascii)) {
if (return_value8[0] < 0 && !(current->start_offset & F_NOMATCH)) {
printf("8 bit: Test should match: [%d] '%s' @ '%s'\n",
total, current->pattern, current->input);
@ -1596,7 +1618,7 @@ static int regression_tests(void)
}
#endif
#ifdef SUPPORT_PCRE16
if (!(current->start_offset & F_NO16) && ((utf && ucp) || is_ascii_input)) {
if (!(current->start_offset & F_NO16) && ((utf && ucp) || is_ascii)) {
if (return_value16[0] < 0 && !(current->start_offset & F_NOMATCH)) {
printf("16 bit: Test should match: [%d] '%s' @ '%s'\n",
total, current->pattern, current->input);
@ -1611,7 +1633,7 @@ static int regression_tests(void)
}
#endif
#ifdef SUPPORT_PCRE32
if (!(current->start_offset & F_NO32) && ((utf && ucp) || is_ascii_input)) {
if (!(current->start_offset & F_NO32) && ((utf && ucp) || is_ascii)) {
if (return_value32[0] < 0 && !(current->start_offset & F_NOMATCH)) {
printf("32 bit: Test should match: [%d] '%s' @ '%s'\n",
total, current->pattern, current->input);

15
pcre/pcre_printint.c

@ -644,7 +644,9 @@ for(;;)
int i;
unsigned int min, max;
BOOL printmap;
BOOL invertmap = FALSE;
pcre_uint8 *map;
pcre_uint8 inverted_map[32];
fprintf(f, " [");
@ -653,7 +655,12 @@ for(;;)
extra = GET(code, 1);
ccode = code + LINK_SIZE + 1;
printmap = (*ccode & XCL_MAP) != 0;
if ((*ccode++ & XCL_NOT) != 0) fprintf(f, "^");
if ((*ccode & XCL_NOT) != 0)
{
invertmap = (*ccode & XCL_HASPROP) == 0;
fprintf(f, "^");
}
ccode++;
}
else
{
@ -666,6 +673,12 @@ for(;;)
if (printmap)
{
map = (pcre_uint8 *)ccode;
if (invertmap)
{
for (i = 0; i < 32; i++) inverted_map[i] = ~map[i];
map = inverted_map;
}
for (i = 0; i < 256; i++)
{
if ((map[i/8] & (1 << (i&7))) != 0)

8
pcre/pcre_string_utils.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -91,8 +91,8 @@ pcre_uchar c2;
while (*str1 != '\0' || *str2 != '\0')
{
c1 = RAWUCHARINC(str1);
c2 = RAWUCHARINC(str2);
c1 = UCHAR21INC(str1);
c2 = UCHAR21INC(str2);
if (c1 != c2)
return ((c1 > c2) << 1) - 1;
}
@ -131,7 +131,7 @@ pcre_uchar c2;
while (*str1 != '\0' || *ustr2 != '\0')
{
c1 = RAWUCHARINC(str1);
c1 = UCHAR21INC(str1);
c2 = (pcre_uchar)*ustr2++;
if (c1 != c2)
return ((c1 > c2) << 1) - 1;

62
pcre/pcre_study.c

@ -879,9 +879,6 @@ do
case OP_SOM:
case OP_THEN:
case OP_THEN_ARG:
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
case OP_XCLASS:
#endif
return SSB_FAIL;
/* We can ignore word boundary tests. */
@ -1257,6 +1254,16 @@ do
with a value >= 0xc4 is a potentially valid starter because it starts a
character with a value > 255. */
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
case OP_XCLASS:
if ((tcode[1 + LINK_SIZE] & XCL_HASPROP) != 0)
return SSB_FAIL;
/* All bits are set. */
if ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0 && (tcode[1 + LINK_SIZE] & XCL_NOT) != 0)
return SSB_FAIL;
#endif
/* Fall through */
case OP_NCLASS:
#if defined SUPPORT_UTF && defined COMPILE_PCRE8
if (utf)
@ -1273,8 +1280,21 @@ do
case OP_CLASS:
{
pcre_uint8 *map;
tcode++;
map = (pcre_uint8 *)tcode;
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
map = NULL;
if (*tcode == OP_XCLASS)
{
if ((tcode[1 + LINK_SIZE] & XCL_MAP) != 0)
map = (pcre_uint8 *)(tcode + 1 + LINK_SIZE + 1);
tcode += GET(tcode, 1);
}
else
#endif
{
tcode++;
map = (pcre_uint8 *)tcode;
tcode += 32 / sizeof(pcre_uchar);
}
/* In UTF-8 mode, the bits in a bit map correspond to character
values, not to byte values. However, the bit map we are constructing is
@ -1282,31 +1302,35 @@ do
value is > 127. In fact, there are only two possible starting bytes for
characters in the range 128 - 255. */
#if defined SUPPORT_UTF && defined COMPILE_PCRE8
if (utf)
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
if (map != NULL)
#endif
{
for (c = 0; c < 16; c++) start_bits[c] |= map[c];
for (c = 128; c < 256; c++)
#if defined SUPPORT_UTF && defined COMPILE_PCRE8
if (utf)
{
if ((map[c/8] && (1 << (c&7))) != 0)
for (c = 0; c < 16; c++) start_bits[c] |= map[c];
for (c = 128; c < 256; c++)
{
int d = (c >> 6) | 0xc0; /* Set bit for this starter */
start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */
c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */
if ((map[c/8] && (1 << (c&7))) != 0)
{
int d = (c >> 6) | 0xc0; /* Set bit for this starter */
start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */
c = (c & 0xc0) + 0x40 - 1; /* next relevant character. */
}
}
}
}
else
else
#endif
{
/* In non-UTF-8 mode, the two bit maps are completely compatible. */
for (c = 0; c < 32; c++) start_bits[c] |= map[c];
{
/* In non-UTF-8 mode, the two bit maps are completely compatible. */
for (c = 0; c < 32; c++) start_bits[c] |= map[c];
}
}
/* Advance past the bit map, and act on what follows. For a zero
minimum repeat, continue; otherwise stop processing. */
tcode += 32 / sizeof(pcre_uchar);
switch (*tcode)
{
case OP_CRSTAR:

5
pcre/pcre_xclass.c

@ -81,6 +81,11 @@ additional data. */
if (c < 256)
{
if ((*data & XCL_HASPROP) == 0)
{
if ((*data & XCL_MAP) == 0) return negated;
return (((pcre_uint8 *)(data + 1))[c/8] & (1 << (c&7))) != 0;
}
if ((*data & XCL_MAP) != 0 &&
(((pcre_uint8 *)(data + 1))[c/8] & (1 << (c&7))) != 0)
return !negated; /* char found */

4
pcre/pcregrep.c

@ -12,7 +12,7 @@ distribution because other apparatus is needed to compile pcregrep for z/OS.
The header can be found in the special z/OS distribution, which is available
from www.zaconsultants.net or from www.cbttape.org.
Copyright (c) 1997-2013 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -1298,7 +1298,7 @@ switch(endlinetype)
while (p > startptr && p[-1] != '\n') p--;
if (p <= startptr + 1 || p[-2] == '\r') return p;
}
return p; /* But control should never get here */
/* Control can never get here */
case EL_ANY:
case EL_ANYCRLF:

6
pcre/pcreposix.c

@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2012 University of Cambridge
Copyright (c) 1997-2014 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@ -170,7 +170,9 @@ static const int eint[] = {
REG_BADPAT, /* missing opening brace after \o */
REG_BADPAT, /* parentheses too deeply nested */
REG_BADPAT, /* invalid range in character class */
REG_BADPAT /* group name must start with a non-digit */
REG_BADPAT, /* group name must start with a non-digit */
/* 85 */
REG_BADPAT /* parentheses too deeply nested (stack check) */
};
/* Table of texts corresponding to POSIX error codes */

92
pcre/pcretest.c

@ -233,6 +233,9 @@ argument, the casting might be incorrectly applied. */
#define SET_PCRE_CALLOUT8(callout) \
pcre_callout = callout
#define SET_PCRE_STACK_GUARD8(stack_guard) \
pcre_stack_guard = stack_guard
#define PCRE_ASSIGN_JIT_STACK8(extra, callback, userdata) \
pcre_assign_jit_stack(extra, callback, userdata)
@ -317,6 +320,9 @@ argument, the casting might be incorrectly applied. */
#define SET_PCRE_CALLOUT16(callout) \
pcre16_callout = (int (*)(pcre16_callout_block *))callout
#define SET_PCRE_STACK_GUARD16(stack_guard) \
pcre16_stack_guard = (int (*)(void))stack_guard
#define PCRE_ASSIGN_JIT_STACK16(extra, callback, userdata) \
pcre16_assign_jit_stack((pcre16_extra *)extra, \
(pcre16_jit_callback)callback, userdata)
@ -406,6 +412,9 @@ argument, the casting might be incorrectly applied. */
#define SET_PCRE_CALLOUT32(callout) \
pcre32_callout = (int (*)(pcre32_callout_block *))callout
#define SET_PCRE_STACK_GUARD32(stack_guard) \
pcre32_stack_guard = (int (*)(void))stack_guard
#define PCRE_ASSIGN_JIT_STACK32(extra, callback, userdata) \
pcre32_assign_jit_stack((pcre32_extra *)extra, \
(pcre32_jit_callback)callback, userdata)
@ -533,6 +542,14 @@ cases separately. */
else \
SET_PCRE_CALLOUT8(callout)
#define SET_PCRE_STACK_GUARD(stack_guard) \
if (pcre_mode == PCRE32_MODE) \
SET_PCRE_STACK_GUARD32(stack_guard); \
else if (pcre_mode == PCRE16_MODE) \
SET_PCRE_STACK_GUARD16(stack_guard); \
else \
SET_PCRE_STACK_GUARD8(stack_guard)
#define STRLEN(p) (pcre_mode == PCRE32_MODE ? STRLEN32(p) : pcre_mode == PCRE16_MODE ? STRLEN16(p) : STRLEN8(p))
#define PCRE_ASSIGN_JIT_STACK(extra, callback, userdata) \
@ -756,6 +773,12 @@ the three different cases. */
else \
G(SET_PCRE_CALLOUT,BITTWO)(callout)
#define SET_PCRE_STACK_GUARD(stack_guard) \
if (pcre_mode == G(G(PCRE,BITONE),_MODE)) \
G(SET_PCRE_STACK_GUARD,BITONE)(stack_guard); \
else \
G(SET_PCRE_STACK_GUARD,BITTWO)(stack_guard)
#define STRLEN(p) ((pcre_mode == G(G(PCRE,BITONE),_MODE)) ? \
G(STRLEN,BITONE)(p) : G(STRLEN,BITTWO)(p))
@ -897,6 +920,7 @@ the three different cases. */
#define PCHARSV PCHARSV8
#define READ_CAPTURE_NAME READ_CAPTURE_NAME8
#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT8
#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD8
#define STRLEN STRLEN8
#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK8
#define PCRE_COMPILE PCRE_COMPILE8
@ -927,6 +951,7 @@ the three different cases. */
#define PCHARSV PCHARSV16
#define READ_CAPTURE_NAME READ_CAPTURE_NAME16
#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT16
#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD16
#define STRLEN STRLEN16
#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK16
#define PCRE_COMPILE PCRE_COMPILE16
@ -957,6 +982,7 @@ the three different cases. */
#define PCHARSV PCHARSV32
#define READ_CAPTURE_NAME READ_CAPTURE_NAME32
#define SET_PCRE_CALLOUT SET_PCRE_CALLOUT32
#define SET_PCRE_STACK_GUARD SET_PCRE_STACK_GUARD32
#define STRLEN STRLEN32
#define PCRE_ASSIGN_JIT_STACK PCRE_ASSIGN_JIT_STACK32
#define PCRE_COMPILE PCRE_COMPILE32
@ -1015,6 +1041,7 @@ static int first_callout;
static int jit_was_used;
static int locale_set = 0;
static int show_malloc;
static int stack_guard_return;
static int use_utf;
static const unsigned char *last_callout_mark = NULL;
@ -2200,6 +2227,18 @@ return p;
/*************************************************
* Stack guard function *
*************************************************/
/* Called from PCRE when set in pcre_stack_guard. We give an error (non-zero)
return when a count overflows. */
static int stack_guard(void)
{
return stack_guard_return;
}
/*************************************************
* Callout function *
*************************************************/
@ -2883,8 +2922,8 @@ printf(" -32 use the 32-bit library\n");
#endif
printf(" -b show compiled code\n");
printf(" -C show PCRE compile-time options and exit\n");
printf(" -C arg show a specific compile-time option\n");
printf(" and exit with its value. The arg can be:\n");
printf(" -C arg show a specific compile-time option and exit\n");
printf(" with its value if numeric (else 0). The arg can be:\n");
printf(" linksize internal link size [2, 3, 4]\n");
printf(" pcre8 8 bit library support enabled [0, 1]\n");
printf(" pcre16 16 bit library support enabled [0, 1]\n");
@ -2892,7 +2931,8 @@ printf(" pcre32 32 bit library support enabled [0, 1]\n");
printf(" utf Unicode Transformation Format supported [0, 1]\n");
printf(" ucp Unicode Properties supported [0, 1]\n");
printf(" jit Just-in-time compiler supported [0, 1]\n");
printf(" newline Newline type [CR, LF, CRLF, ANYCRLF, ANY, ???]\n");
printf(" newline Newline type [CR, LF, CRLF, ANYCRLF, ANY]\n");
printf(" bsr \\R type [ANYCRLF, ANY]\n");
printf(" -d debug: show compiled code and information (-b and -i)\n");
#if !defined NODFA
printf(" -dfa force DFA matching for all subjects\n");
@ -3231,6 +3271,11 @@ while (argc > 1 && argv[op][0] == '-')
(void)PCRE_CONFIG(PCRE_CONFIG_NEWLINE, &rc);
print_newline_config(rc, TRUE);
}
else if (strcmp(argv[op + 1], "bsr") == 0)
{
(void)PCRE_CONFIG(PCRE_CONFIG_BSR, &rc);
printf("%s\n", rc? "ANYCRLF" : "ANY");
}
else if (strcmp(argv[op + 1], "ebcdic") == 0)
{
#ifdef EBCDIC
@ -3439,6 +3484,7 @@ while (!done)
use_utf = 0;
debug_lengths = 1;
SET_PCRE_STACK_GUARD(NULL);
if (extend_inputline(infile, buffer, " re> ") == NULL) break;
if (infile != stdin) fprintf(outfile, "%s", (char *)buffer);
@ -3739,6 +3785,21 @@ while (!done)
case 'P': do_posix = 1; break;
#endif
case 'Q':
switch (*pp)
{
case '0':
case '1':
stack_guard_return = *pp++ - '0';
break;
default:
fprintf(outfile, "** Missing 0 or 1 after /Q\n");
goto SKIP_DATA;
}
SET_PCRE_STACK_GUARD(stack_guard);
break;
case 'S':
do_study = 1;
for (;;)
@ -4282,12 +4343,12 @@ while (!done)
if (new_info(re, extra, PCRE_INFO_FIRSTTABLE, &start_bits) == 0)
{
if (start_bits == NULL)
fprintf(outfile, "No set of starting bytes\n");
fprintf(outfile, "No starting char list\n");
else
{
int i;
int c = 24;
fprintf(outfile, "Starting byte set: ");
fprintf(outfile, "Starting chars: ");
for (i = 0; i < 256; i++)
{
if ((start_bits[i/8] & (1<<(i&7))) != 0)
@ -5192,7 +5253,8 @@ while (!done)
if (count * 2 > use_size_offsets) count = use_size_offsets/2;
}
/* Output the captured substrings */
/* Output the captured substrings. Note that, for the matched string,
the use of \K in an assertion can make the start later than the end. */
for (i = 0; i < count * 2; i += 2)
{
@ -5208,11 +5270,25 @@ while (!done)
}
else
{
int start = use_offsets[i];
int end = use_offsets[i+1];
if (start > end)
{
start = use_offsets[i+1];
end = use_offsets[i];
fprintf(outfile, "Start of matched string is beyond its end - "
"displaying from end to start.\n");
}
fprintf(outfile, "%2d: ", i/2);
PCHARSV(bptr, use_offsets[i],
use_offsets[i+1] - use_offsets[i], outfile);
PCHARSV(bptr, start, end - start, outfile);
if (verify_jit && jit_was_used) fprintf(outfile, " (JIT)");
fprintf(outfile, "\n");
/* Note: don't use the start/end variables here because we want to
show the text from what is reported as the end. */
if (do_showcaprest || (i == 0 && do_showrest))
{
fprintf(outfile, "%2d+ ", i/2);

BIN
pcre/testdata/saved16BE-1

BIN
pcre/testdata/saved16LE-1

BIN
pcre/testdata/saved32BE-1

BIN
pcre/testdata/saved32LE-1

2
pcre/testdata/testinput18

@ -207,7 +207,7 @@ correctly, but that messes up comparisons). --/
CDBABC
\x{2000}ABC
/\R*A/SI8
/\R*A/SI8<bsr_unicode>
CDBABC
\x{2028}A

17
pcre/testdata/testinput2

@ -907,6 +907,9 @@
/\U/I
/a{1,3}b/U
ab
/[/I
/[a-/I
@ -4045,4 +4048,18 @@ backtracking verbs. --/
/[a[:<:]] should give error/
/(?=ab\K)/+
abcd
/abcd/f<lf>
xx\nxabcd
/ -- Test stack check external calls --/
/(((((a)))))/Q0
/(((((a)))))/Q1
/(((((a)))))/Q
/-- End of testinput2 --/

2
pcre/testdata/testinput25

@ -1,6 +1,6 @@
/-- Tests for the 32-bit library only */
< forbid 8w
< forbid 8W
/-- Check maximum character size --/

11
pcre/testdata/testinput3

@ -1,7 +1,10 @@
/-- This set of tests checks local-specific features, using the fr_FR locale.
It is not Perl-compatible. There is different version called wintestinput3
f or use on Windows, where the locale is called "french". --/
/-- This set of tests checks local-specific features, using the "fr_FR" locale.
It is not Perl-compatible. When run via RunTest, the locale is edited to
be whichever of "fr_FR", "french", or "fr" is found to exist. There is
different version of this file called wintestinput3 for use on Windows,
where the locale is called "french" and the tests are run using
RunTest.bat. --/
< forbid 8W
/^[\w]+/

6
pcre/testdata/testinput4

@ -716,4 +716,10 @@
/^a+[a\x{200}]/8
aa
/^.\B.\B./8
\x{10123}\x{10124}\x{10125}
/^#[^\x{ffff}]#[^\x{ffff}]#[^\x{ffff}]#/8
#\x{10000}#\x{100}#\x{10ffff}#
/-- End of testinput4 --/

2
pcre/testdata/testinput5

@ -788,4 +788,6 @@
/^a+[a\x{200}]/8BZ
aa
/[b-d\x{200}-\x{250}]*[ae-h]?#[\x{200}-\x{250}]{0,8}[\x00-\xff]*#[\x{200}-\x{250}]+[a-z]/8BZ
/-- End of testinput5 --/

9
pcre/testdata/testinput6

@ -1484,4 +1484,13 @@
\x{a1}\x{a7}
\x{37e}
/[RST]+/8iW
Ss\x{17f}
/[R-T]+/8iW
Ss\x{17f}
/[q-u]+/8iW
Ss\x{17f}
/-- End of testinput6 --/

6
pcre/testdata/testinput7

@ -829,4 +829,10 @@ of case for anything other than the ASCII letters. --/
/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/8WBZ
/[RST]+/8iWBZ
/[R-T]+/8iWBZ
/[Q-U]+/8iWBZ
/-- End of testinput7 --/

8
pcre/testdata/testoutput12

@ -8,7 +8,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
No set of starting bytes
No starting char list
JIT study was successful
/(?(?C1)(?=a)a)/S+I
@ -27,7 +27,7 @@ No options
No first char
No need char
Subject length lower bound = -1
No set of starting bytes
No starting char list
JIT study was not successful
/abc/S+I>testsavedregex
@ -36,7 +36,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
No set of starting bytes
No starting char list
JIT study was successful
Compiled pattern written to testsavedregex
Study data written to testsavedregex
@ -165,7 +165,7 @@ No options
First char = 'a'
Need char = 'd'
Subject length lower bound = 4
No set of starting bytes
No starting char list
JIT study was successful
/(*NO_START_OPT)a(*:m)b/KS++

2
pcre/testdata/testoutput13

@ -8,7 +8,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
No set of starting bytes
No starting char list
JIT support is not available in this version of PCRE
/a*/SI

12
pcre/testdata/testoutput14

@ -361,7 +361,7 @@ Options: extended
No first char
No need char
Subject length lower bound = 3
Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
Starting chars: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e
f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f
@ -388,7 +388,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xa0
Starting chars: \x09 \x20 \xa0
/\H/SI
Capturing subpattern count = 0
@ -396,7 +396,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\v/SI
Capturing subpattern count = 0
@ -404,7 +404,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85
Starting chars: \x0a \x0b \x0c \x0d \x85
/\V/SI
Capturing subpattern count = 0
@ -412,7 +412,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\R/SI
Capturing subpattern count = 0
@ -420,7 +420,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85
Starting chars: \x0a \x0b \x0c \x0d \x85
/[\h]/BZ
------------------------------------------------------------------

36
pcre/testdata/testoutput15

@ -481,7 +481,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
\x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
\x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
@ -519,7 +519,7 @@ Options: utf
First char = \x{c4}
Need char = \x{80}
Subject length lower bound = 3
No set of starting bytes
No starting char list
\x{100}\x{100}\x{100}\x{100\x{100}
0: \x{100}\x{100}\x{100}
@ -539,7 +539,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xc4
Starting chars: x \xc4
/(\x{100}*a|x)/8SDZ
------------------------------------------------------------------
@ -558,7 +558,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xc4
Starting chars: a x \xc4
/(\x{100}{0,2}a|x)/8SDZ
------------------------------------------------------------------
@ -577,7 +577,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xc4
Starting chars: a x \xc4
/(\x{100}{1,2}a|x)/8SDZ
------------------------------------------------------------------
@ -597,7 +597,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xc4
Starting chars: x \xc4
/\x{100}/8DZ
------------------------------------------------------------------
@ -799,7 +799,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xc2 \xe1 \xe2 \xe3
Starting chars: \x09 \x20 \xc2 \xe1 \xe2 \xe3
ABC\x{09}
0: \x{09}
ABC\x{20}
@ -825,7 +825,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2
Starting chars: \x0a \x0b \x0c \x0d \xc2 \xe2
ABC\x{0a}
0: \x{0a}
ABC\x{0b}
@ -845,7 +845,7 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 1
Starting byte set: \x09 \x20 A \xc2 \xe1 \xe2 \xe3
Starting chars: \x09 \x20 A \xc2 \xe1 \xe2 \xe3
CDBABC
0: A
@ -855,7 +855,7 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 2
Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2
Starting chars: \x0a \x0b \x0c \x0d \xc2 \xe2
/\s?xxx\s/8SI
Capturing subpattern count = 0
@ -863,7 +863,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 4
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20 x
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 x
/\sxxx\s/I8ST1
Capturing subpattern count = 0
@ -871,7 +871,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 5
Starting byte set: \x09 \x0a \x0c \x0d \x20 \xc2
Starting chars: \x09 \x0a \x0c \x0d \x20 \xc2
AB\x{85}xxx\x{a0}XYZ
0: \x{85}xxx\x{a0}
AB\x{a0}xxx\x{85}XYZ
@ -883,7 +883,7 @@ Options: utf
No first char
Need char = ' '
Subject length lower bound = 3
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
\x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
\x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
@ -917,7 +917,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \xe1
Starting chars: \xe1
/\x{1234}+?/iS8I
Capturing subpattern count = 0
@ -925,7 +925,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \xe1
Starting chars: \xe1
/\x{1234}++/iS8I
Capturing subpattern count = 0
@ -933,7 +933,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \xe1
Starting chars: \xe1
/\x{1234}{2}/iS8I
Capturing subpattern count = 0
@ -941,7 +941,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 2
Starting byte set: \xe1
Starting chars: \xe1
/[^\x{c4}]/8DZ
------------------------------------------------------------------
@ -974,7 +974,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \xc2 \xe2
Starting chars: \x0a \x0b \x0c \x0d \xc2 \xe2
/\777/8DZ
------------------------------------------------------------------

8
pcre/testdata/testoutput16

@ -64,7 +64,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 17
Starting byte set: \xd0 \xd1
Starting chars: \xd0 \xd1
\x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}
0: \x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}
\x{451}\x{440}\x{441}\x{442}\x{443}\x{444}\x{445}\x{446}\x{447}\x{448}\x{449}\x{44a}\x{44b}\x{44c}\x{44d}\x{44e}\x{44f}
@ -92,7 +92,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xa0
Starting chars: \x09 \x20 \xa0
/\v/SI
Capturing subpattern count = 0
@ -100,7 +100,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85
Starting chars: \x0a \x0b \x0c \x0d \x85
/\R/SI
Capturing subpattern count = 0
@ -108,7 +108,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85
Starting chars: \x0a \x0b \x0c \x0d \x85
/[[:blank:]]/WBZ
------------------------------------------------------------------

28
pcre/testdata/testoutput17

@ -228,7 +228,7 @@ Options: extended
No first char
No need char
Subject length lower bound = 3
Starting byte set: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
Starting chars: \x09 \x20 ! " # $ % & ' ( * + - / 0 1 2 3 4 5 6 7 8
9 = ? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ^ _ ` a b c d e
f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \xff
@ -274,7 +274,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xa0 \xff
Starting chars: \x09 \x20 \xa0 \xff
\x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
0: \x{1680}\x{2000}\x{202f}\x{3000}
\x{3001}\x{2fff}\x{200a}\xa0\x{2000}
@ -292,7 +292,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x09 \x20 \xa0 \xff
\x{1681}\x{200b}\x{1680}\x{2000}\x{202f}\x{3000}
0: \x{1680}\x{2000}\x{202f}\x{3000}
\x{3001}\x{2fff}\x{200a}\xa0\x{2000}
@ -304,7 +304,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
\x{1680}\x{180e}\x{167f}\x{1681}\x{180d}\x{180f}
0: \x{167f}\x{1681}\x{180d}\x{180f}
\x{2000}\x{200a}\x{1fff}\x{200b}
@ -330,7 +330,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
\x{2027}\x{2030}\x{2028}\x{2029}
0: \x{2028}\x{2029}
\x09\x0e\x84\x86\x85\x0a\x0b\x0c\x0d
@ -348,7 +348,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
\x{2027}\x{2030}\x{2028}\x{2029}
0: \x{2028}\x{2029}
\x09\x0e\x84\x86\x85\x0a\x0b\x0c\x0d
@ -360,7 +360,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
\x{2028}\x{2029}\x{2027}\x{2030}
0: \x{2027}\x{2030}
\x85\x0a\x0b\x0c\x0d\x09\x0e\x84\x86
@ -378,7 +378,7 @@ Options: bsr_unicode
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
\x{2027}\x{2030}\x{2028}\x{2029}
0: \x{2028}\x{2029}
\x09\x0e\x84\x86\x85\x0a\x0b\x0c\x0d
@ -534,18 +534,18 @@ MK: 0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789AB
------------------------------------------------------------------
Bra
a*
[b-\x{200}]?+
[b-\xff\x{100}-\x{200}]?+
a#
a*+
[b-\x{200}]?
[b-\xff\x{100}-\x{200}]?
b#
[a-f]*
[g-\x{200}]*+
[a-f]*+
[g-\xff\x{100}-\x{200}]*+
#
[g-\x{200}]*
[g-\xff\x{100}-\x{200}]*+
[a-c]*+
#
[g-\x{200}]*
[g-\xff\x{100}-\x{200}]*
[a-h]*+
Ket
End

42
pcre/testdata/testoutput18-16

@ -339,7 +339,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
\x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
\x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
@ -378,7 +378,7 @@ Options: utf
First char = \x{100}
Need char = \x{100}
Subject length lower bound = 3
No set of starting bytes
No starting char list
\x{100}\x{100}\x{100}\x{100\x{100}
0: \x{100}\x{100}\x{100}
@ -398,7 +398,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xff
Starting chars: x \xff
/(\x{100}*a|x)/8SDZ
------------------------------------------------------------------
@ -417,7 +417,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xff
Starting chars: a x \xff
/(\x{100}{0,2}a|x)/8SDZ
------------------------------------------------------------------
@ -436,7 +436,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xff
Starting chars: a x \xff
/(\x{100}{1,2}a|x)/8SDZ
------------------------------------------------------------------
@ -456,7 +456,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xff
Starting chars: x \xff
/\x{100}/8DZ
------------------------------------------------------------------
@ -666,7 +666,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xa0 \xff
Starting chars: \x09 \x20 \xa0 \xff
ABC\x{09}
0: \x{09}
ABC\x{20}
@ -692,7 +692,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
ABC\x{0a}
0: \x{0a}
ABC\x{0b}
@ -712,19 +712,19 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 1
Starting byte set: \x09 \x20 A \xa0 \xff
Starting chars: \x09 \x20 A \xa0 \xff
CDBABC
0: A
\x{2000}ABC
0: \x{2000}A
/\R*A/SI8
/\R*A/SI8<bsr_unicode>
Capturing subpattern count = 0
Options: utf
Options: bsr_unicode utf
No first char
Need char = 'A'
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d A \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d A \x85 \xff
CDBABC
0: A
\x{2028}A
@ -736,7 +736,7 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 2
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
/\s?xxx\s/8SI
Capturing subpattern count = 0
@ -744,7 +744,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 4
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20 x
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 x
/\sxxx\s/I8ST1
Capturing subpattern count = 0
@ -752,7 +752,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 5
Starting byte set: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
Starting chars: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
AB\x{85}xxx\x{a0}XYZ
0: \x{85}xxx\x{a0}
AB\x{a0}xxx\x{85}XYZ
@ -764,7 +764,7 @@ Options: utf
No first char
Need char = ' '
Subject length lower bound = 3
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
\x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
\x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
@ -803,7 +803,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}+?/iS8I
Capturing subpattern count = 0
@ -811,7 +811,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}++/iS8I
Capturing subpattern count = 0
@ -819,7 +819,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}{2}/iS8I
Capturing subpattern count = 0
@ -827,7 +827,7 @@ Options: caseless utf
First char = \x{1234}
Need char = \x{1234}
Subject length lower bound = 2
No set of starting bytes
No starting char list
/[^\x{c4}]/8DZ
------------------------------------------------------------------
@ -860,7 +860,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
/-- Check bad offset --/

42
pcre/testdata/testoutput18-32

@ -337,7 +337,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
\x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
\x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4
5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y
@ -376,7 +376,7 @@ Options: utf
First char = \x{100}
Need char = \x{100}
Subject length lower bound = 3
No set of starting bytes
No starting char list
\x{100}\x{100}\x{100}\x{100\x{100}
0: \x{100}\x{100}\x{100}
@ -396,7 +396,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xff
Starting chars: x \xff
/(\x{100}*a|x)/8SDZ
------------------------------------------------------------------
@ -415,7 +415,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xff
Starting chars: a x \xff
/(\x{100}{0,2}a|x)/8SDZ
------------------------------------------------------------------
@ -434,7 +434,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: a x \xff
Starting chars: a x \xff
/(\x{100}{1,2}a|x)/8SDZ
------------------------------------------------------------------
@ -454,7 +454,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: x \xff
Starting chars: x \xff
/\x{100}/8DZ
------------------------------------------------------------------
@ -663,7 +663,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x20 \xa0 \xff
Starting chars: \x09 \x20 \xa0 \xff
ABC\x{09}
0: \x{09}
ABC\x{20}
@ -689,7 +689,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
ABC\x{0a}
0: \x{0a}
ABC\x{0b}
@ -709,19 +709,19 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 1
Starting byte set: \x09 \x20 A \xa0 \xff
Starting chars: \x09 \x20 A \xa0 \xff
CDBABC
0: A
\x{2000}ABC
0: \x{2000}A
/\R*A/SI8
/\R*A/SI8<bsr_unicode>
Capturing subpattern count = 0
Options: utf
Options: bsr_unicode utf
No first char
Need char = 'A'
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d A \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d A \x85 \xff
CDBABC
0: A
\x{2028}A
@ -733,7 +733,7 @@ Options: utf
No first char
Need char = 'A'
Subject length lower bound = 2
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
/\s?xxx\s/8SI
Capturing subpattern count = 0
@ -741,7 +741,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 4
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20 x
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 x
/\sxxx\s/I8ST1
Capturing subpattern count = 0
@ -749,7 +749,7 @@ Options: utf
No first char
Need char = 'x'
Subject length lower bound = 5
Starting byte set: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
Starting chars: \x09 \x0a \x0c \x0d \x20 \x85 \xa0
AB\x{85}xxx\x{a0}XYZ
0: \x{85}xxx\x{a0}
AB\x{a0}xxx\x{85}XYZ
@ -761,7 +761,7 @@ Options: utf
No first char
Need char = ' '
Subject length lower bound = 3
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0b \x0e
\x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
\x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e
@ -800,7 +800,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}+?/iS8I
Capturing subpattern count = 0
@ -808,7 +808,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}++/iS8I
Capturing subpattern count = 0
@ -816,7 +816,7 @@ Options: caseless utf
First char = \x{1234}
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/\x{1234}{2}/iS8I
Capturing subpattern count = 0
@ -824,7 +824,7 @@ Options: caseless utf
First char = \x{1234}
Need char = \x{1234}
Subject length lower bound = 2
No set of starting bytes
No starting char list
/[^\x{c4}]/8DZ
------------------------------------------------------------------
@ -857,7 +857,7 @@ Options: utf
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x0a \x0b \x0c \x0d \x85 \xff
Starting chars: \x0a \x0b \x0c \x0d \x85 \xff
/-- Check bad offset --/

2
pcre/testdata/testoutput19

@ -55,7 +55,7 @@ Options: caseless utf
First char = \x{401} (caseless)
Need char = \x{42f} (caseless)
Subject length lower bound = 17
No set of starting bytes
No starting char list
\x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}
0: \x{401}\x{420}\x{421}\x{422}\x{423}\x{424}\x{425}\x{426}\x{427}\x{428}\x{429}\x{42a}\x{42b}\x{42c}\x{42d}\x{42e}\x{42f}
\x{451}\x{440}\x{441}\x{442}\x{443}\x{444}\x{445}\x{446}\x{447}\x{448}\x{449}\x{44a}\x{44b}\x{44c}\x{44d}\x{44e}\x{44f}

192
pcre/testdata/testoutput2

@ -178,7 +178,7 @@ No options
No first char
No need char
Subject length lower bound = 3
Starting byte set: c d e
Starting chars: c d e
this sentence eventually mentions a cat
0: cat
this sentences rambles on and on for a while and then reaches elephant
@ -190,7 +190,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 3
Starting byte set: C D E c d e
Starting chars: C D E c d e
this sentence eventually mentions a CAT cat
0: CAT
this sentences rambles on and on for a while to elephant ElePhant
@ -202,7 +202,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/(a|[^\dZ])/IS
Capturing subpattern count = 1
@ -210,7 +210,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
\x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
\x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y [ \ ] ^ _ ` a b c d
@ -231,7 +231,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20 a b
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 a b
/(ab\2)/
Failed: reference to non-existent subpattern at offset 6
@ -512,7 +512,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/(?i)[abcd]/IS
Capturing subpattern count = 0
@ -520,7 +520,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 1
Starting byte set: A B C D a b c d
Starting chars: A B C D a b c d
/(?m)[xy]|(b|c)/IS
Capturing subpattern count = 1
@ -528,7 +528,7 @@ Options: multiline
No first char
No need char
Subject length lower bound = 1
Starting byte set: b c x y
Starting chars: b c x y
/(^a|^b)/Im
Capturing subpattern count = 1
@ -591,7 +591,7 @@ No options
First char = 'b' (caseless)
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/(a*b|(?i:c*(?-i)d))/IS
Capturing subpattern count = 1
@ -599,7 +599,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: C a b c d
Starting chars: C a b c d
/a$/I
Capturing subpattern count = 0
@ -666,7 +666,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
/(?<!foo)(alpha|omega)/IS
Capturing subpattern count = 1
@ -675,7 +675,7 @@ No options
No first char
Need char = 'a'
Subject length lower bound = 5
Starting byte set: a o
Starting chars: a o
/(?!alphabet)[ab]/IS
Capturing subpattern count = 0
@ -683,7 +683,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
/(?<=foo\n)^bar/Im
Capturing subpattern count = 0
@ -1642,7 +1642,7 @@ Options: anchored
No first char
Need char = 'd'
Subject length lower bound = 4
No set of starting bytes
No starting char list
/\( # ( at start
(?: # Non-capturing bracket
@ -1875,7 +1875,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Starting chars: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
_ a b c d e f g h i j k l m n o p q r s t u v w x y z
/^[[:ascii:]]/DZ
@ -1937,7 +1937,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20
/^[[:cntrl:]]/DZ
------------------------------------------------------------------
@ -3178,6 +3178,10 @@ Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
/\U/I
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
/a{1,3}b/U
ab
0: ab
/[/I
Failed: missing terminating ] for character class at offset 1
@ -3434,7 +3438,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
/[^a]/I
Capturing subpattern count = 0
@ -3454,7 +3458,7 @@ No options
No first char
Need char = '6'
Subject length lower bound = 4
Starting byte set: 0 1 2 3 4 5 6 7 8 9
Starting chars: 0 1 2 3 4 5 6 7 8 9
/a^b/I
Capturing subpattern count = 0
@ -3488,7 +3492,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 1
Starting byte set: A B a b
Starting chars: A B a b
/[ab](?i)cd/IS
Capturing subpattern count = 0
@ -3496,7 +3500,7 @@ No options
No first char
Need char = 'd' (caseless)
Subject length lower bound = 3
Starting byte set: a b
Starting chars: a b
/abc(?C)def/I
Capturing subpattern count = 0
@ -3537,7 +3541,7 @@ No options
No first char
Need char = 'f'
Subject length lower bound = 7
Starting byte set: 0 1 2 3 4 5 6 7 8 9
Starting chars: 0 1 2 3 4 5 6 7 8 9
1234abcdef
--->1234abcdef
1 ^ \d
@ -3856,7 +3860,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
/(?R)/I
Failed: recursive call could loop indefinitely at offset 3
@ -4637,7 +4641,7 @@ Options: caseless
No first char
Need char = 'g' (caseless)
Subject length lower bound = 8
No set of starting bytes
No starting char list
Baby Bjorn Active Carrier - With free SHIPPING!!
0: Baby Bjorn Active Carrier - With free SHIPPING!!
1: Baby Bjorn Active Carrier - With free SHIPPING!!
@ -4656,7 +4660,7 @@ No options
No first char
Need char = 'b'
Subject length lower bound = 1
No set of starting bytes
No starting char list
/(a|b)*.?c/ISDZ
------------------------------------------------------------------
@ -4677,7 +4681,7 @@ No options
No first char
Need char = 'c'
Subject length lower bound = 1
No set of starting bytes
No starting char list
/abc(?C255)de(?C)f/DZ
------------------------------------------------------------------
@ -4750,7 +4754,7 @@ Options:
No first char
Need char = 'b'
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
ab
--->ab
+0 ^ a*
@ -4893,7 +4897,7 @@ Options:
No first char
Need char = 'x'
Subject length lower bound = 4
Starting byte set: a d
Starting chars: a d
abcx
--->abcx
+0 ^ (abc|def)
@ -5127,7 +5131,7 @@ Options:
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b x
Starting chars: a b x
Note: that { does NOT introduce a quantifier
--->Note: that { does NOT introduce a quantifier
+0 ^ ([ab]{,4}c|xy)
@ -5607,7 +5611,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
No set of starting bytes
No starting char list
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@ -5642,7 +5646,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
No set of starting bytes
No starting char list
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@ -5677,7 +5681,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@ -5716,7 +5720,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b
Starting chars: a b
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@ -6431,7 +6435,7 @@ No options
No first char
Need char = ','
Subject length lower bound = 1
Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20 ,
Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 ,
\x0b,\x0b
0: \x0b,\x0b
\x0c,\x0d
@ -6738,7 +6742,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: C a b c d
Starting chars: C a b c d
/()[ab]xyz/IS
Capturing subpattern count = 1
@ -6746,7 +6750,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b
Starting chars: a b
/(|)[ab]xyz/IS
Capturing subpattern count = 1
@ -6754,7 +6758,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b
Starting chars: a b
/(|c)[ab]xyz/IS
Capturing subpattern count = 1
@ -6762,7 +6766,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b c
Starting chars: a b c
/(|c?)[ab]xyz/IS
Capturing subpattern count = 1
@ -6770,7 +6774,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b c
Starting chars: a b c
/(d?|c?)[ab]xyz/IS
Capturing subpattern count = 1
@ -6778,7 +6782,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b c d
Starting chars: a b c d
/(d?|c)[ab]xyz/IS
Capturing subpattern count = 1
@ -6786,7 +6790,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
Starting byte set: a b c d
Starting chars: a b c d
/^a*b\d/DZ
------------------------------------------------------------------
@ -6879,7 +6883,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/(a+|b*)[cd]/IS
Capturing subpattern count = 1
@ -6887,7 +6891,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/(a*|b+)[cd]/IS
Capturing subpattern count = 1
@ -6895,7 +6899,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/(a+|b+)[cd]/IS
Capturing subpattern count = 1
@ -6903,7 +6907,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
@ -9307,7 +9311,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: x y z
Starting chars: x y z
/(?(?=.*b)b|^)/CI
Capturing subpattern count = 0
@ -10096,7 +10100,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/(a|bc)\1{2,3}/SI
Capturing subpattern count = 1
@ -10105,7 +10109,7 @@ No options
No first char
No need char
Subject length lower bound = 3
Starting byte set: a b
Starting chars: a b
/(a|bc)(?1)/SI
Capturing subpattern count = 1
@ -10113,7 +10117,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/(a|b\1)(a|b\1)/SI
Capturing subpattern count = 2
@ -10122,7 +10126,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/(a|b\1){2}/SI
Capturing subpattern count = 1
@ -10131,7 +10135,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/(a|bbbb\1)(a|bbbb\1)/SI
Capturing subpattern count = 2
@ -10140,7 +10144,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/(a|bbbb\1){2}/SI
Capturing subpattern count = 1
@ -10149,7 +10153,7 @@ No options
No first char
No need char
Subject length lower bound = 2
Starting byte set: a b
Starting chars: a b
/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI
Capturing subpattern count = 1
@ -10157,7 +10161,7 @@ Options: anchored
No first char
Need char = ':'
Subject length lower bound = 22
No set of starting bytes
No starting char list
/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS
Capturing subpattern count = 11
@ -10165,7 +10169,7 @@ Options: caseless dotall
First char = '<'
Need char = '>'
Subject length lower bound = 47
No set of starting bytes
No starting char list
"(?>.*/)foo"SI
Capturing subpattern count = 0
@ -10173,7 +10177,7 @@ No options
No first char
Need char = 'o'
Subject length lower bound = 4
No set of starting bytes
No starting char list
/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
Capturing subpattern count = 0
@ -10181,7 +10185,7 @@ Options: extended
No first char
Need char = '-'
Subject length lower bound = 8
No set of starting bytes
No starting char list
/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
Capturing subpattern count = 1
@ -10189,7 +10193,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 1
Starting byte set: A B C a b c
Starting chars: A B C a b c
/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
Capturing subpattern count = 0
@ -10197,7 +10201,7 @@ No options
No first char
Need char = 'b'
Subject length lower bound = 41
Starting byte set: c d
Starting chars: c d
/<a[\s]+href[\s]*=[\s]* # find <a href=
([\"\'])? # find single or double quote
@ -10210,7 +10214,7 @@ Options: caseless extended dotall
First char = '<'
Need char = '='
Subject length lower bound = 9
No set of starting bytes
No starting char list
/^(?!:) # colon disallowed at start
(?: # start of item
@ -10226,7 +10230,7 @@ Options: anchored caseless extended
No first char
Need char = ':'
Subject length lower bound = 2
No set of starting bytes
No starting char list
/(?|(?<a>A)|(?<a>B))/I
Capturing subpattern count = 1
@ -10450,7 +10454,7 @@ Options:
No first char
Need char = 'a'
Subject length lower bound = 1
No set of starting bytes
No starting char list
cat
0: a
1:
@ -10464,7 +10468,7 @@ No options
No first char
Need char = 'a'
Subject length lower bound = 3
No set of starting bytes
No starting char list
cat
No match
@ -10476,7 +10480,7 @@ No options
First char = 'i'
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
i
0: i
@ -10486,7 +10490,7 @@ No options
No first char
Need char = 'i'
Subject length lower bound = 1
Starting byte set: i
Starting chars: i
ia
0: ia
1:
@ -11080,7 +11084,7 @@ No options
First char = 'a'
Need char = '4'
Subject length lower bound = 5
No set of starting bytes
No starting char list
/([abc])++1234/SI
Capturing subpattern count = 1
@ -11088,7 +11092,7 @@ No options
No first char
Need char = '4'
Subject length lower bound = 5
Starting byte set: a b c
Starting chars: a b c
/(?<=(abc)+)X/
Failed: lookbehind assertion is not fixed length at offset 10
@ -11369,7 +11373,7 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
Capturing subpattern count = 2
@ -11377,7 +11381,7 @@ No options
No first char
No need char
Subject length lower bound = 3
Starting byte set: a b
Starting chars: a b
/(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
Capturing subpattern count = 2
@ -11385,7 +11389,7 @@ No options
No first char
No need char
Subject length lower bound = 4
Starting byte set: a b
Starting chars: a b
/(abc)(?1)/SI
Capturing subpattern count = 1
@ -11393,7 +11397,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 6
No set of starting bytes
No starting char list
/^(?>a)++/
aa\M
@ -11711,7 +11715,7 @@ No options
First char = 't'
Need char = 't'
Subject length lower bound = 18
No set of starting bytes
No starting char list
/\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
Capturing subpattern count = 0
@ -11720,7 +11724,7 @@ No options
No first char
No need char
Subject length lower bound = 8
Starting byte set: < o t u
Starting chars: < o t u
/a(*SKIP)c|b(*ACCEPT)|/+S!I
Capturing subpattern count = 0
@ -11729,7 +11733,7 @@ No options
No first char
No need char
Subject length lower bound = -1
No set of starting bytes
No starting char list
a
0:
0+
@ -11740,7 +11744,7 @@ No options
No first char
No need char
Subject length lower bound = -1
Starting byte set: a b x
Starting chars: a b x
ax
0: x
@ -12436,7 +12440,7 @@ No options
No first char
No need char
Subject length lower bound = -1
No set of starting bytes
No starting char list
/(?:(a)+(?C1)bb|aa(?C2)b)/
aab\C+
@ -12722,7 +12726,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
Starting byte set: a z
Starting chars: a z
aaaaaaaaaaaaaz
Error -21 (recursion limit exceeded)
aaaaaaaaaaaaaz\Q1000
@ -12735,7 +12739,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
Starting byte set: a z
Starting chars: a z
aaaaaaaaaaaaaz
Error -21 (recursion limit exceeded)
@ -12746,7 +12750,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
Starting byte set: a z
Starting chars: a z
aaaaaaaaaaaaaz
No match
aaaaaaaaaaaaaz\Q10
@ -12790,7 +12794,7 @@ Options: dupnames
First char = 'a'
Need char = 'z'
Subject length lower bound = 5
No set of starting bytes
No starting char list
/a*[bcd]/BZ
------------------------------------------------------------------
@ -13902,7 +13906,7 @@ No options
No first char
Need char = 'd'
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/[a-c]+d/DZS
------------------------------------------------------------------
@ -13917,7 +13921,7 @@ No options
No first char
Need char = 'd'
Subject length lower bound = 2
Starting byte set: a b c
Starting chars: a b c
/[a-c]?d/DZS
------------------------------------------------------------------
@ -13932,7 +13936,7 @@ No options
No first char
Need char = 'd'
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/[a-c]{4,6}d/DZS
------------------------------------------------------------------
@ -13947,7 +13951,7 @@ No options
No first char
Need char = 'd'
Subject length lower bound = 5
Starting byte set: a b c
Starting chars: a b c
/[a-c]{0,6}d/DZS
------------------------------------------------------------------
@ -13962,7 +13966,7 @@ No options
No first char
Need char = 'd'
Subject length lower bound = 1
Starting byte set: a b c d
Starting chars: a b c d
/-- End of special auto-possessive tests --/
@ -14125,4 +14129,24 @@ No match
/[a[:<:]] should give error/
Failed: unknown POSIX class name at offset 4
/(?=ab\K)/+
abcd
Start of matched string is beyond its end - displaying from end to start.
0: ab
0+ abcd
/abcd/f<lf>
xx\nxabcd
No match
/ -- Test stack check external calls --/
/(((((a)))))/Q0
/(((((a)))))/Q1
Failed: parentheses are too deeply nested (stack check) at offset 0
/(((((a)))))/Q
** Missing 0 or 1 after /Q
/-- End of testinput2 --/

4
pcre/testdata/testoutput21-16

@ -50,7 +50,7 @@ Options: anchored extended
No first char
No need char
Subject length lower bound = 6
No set of starting bytes
No starting char list
<!testsaved16BE-1
Compiled pattern loaded from testsaved16BE-1
@ -83,7 +83,7 @@ Options: anchored extended
No first char
No need char
Subject length lower bound = 6
No set of starting bytes
No starting char list
<!testsaved32LE-1
Compiled pattern loaded from testsaved32LE-1

4
pcre/testdata/testoutput21-32

@ -62,7 +62,7 @@ Options: anchored extended
No first char
No need char
Subject length lower bound = 6
No set of starting bytes
No starting char list
<!testsaved32BE-1
Compiled pattern loaded from testsaved32BE-1
@ -95,6 +95,6 @@ Options: anchored extended
No first char
No need char
Subject length lower bound = 6
No set of starting bytes
No starting char list
/-- End of testinput21 --/

4
pcre/testdata/testoutput22-16

@ -37,7 +37,7 @@ Options: extended utf
No first char
No need char
Subject length lower bound = 2
No set of starting bytes
No starting char list
<!testsaved16BE-2
Compiled pattern loaded from testsaved16BE-2
@ -64,7 +64,7 @@ Options: extended utf
No first char
No need char
Subject length lower bound = 2
No set of starting bytes
No starting char list
<!testsaved32LE-2
Compiled pattern loaded from testsaved32LE-2

4
pcre/testdata/testoutput22-32

@ -49,7 +49,7 @@ Options: extended utf
No first char
No need char
Subject length lower bound = 2
No set of starting bytes
No starting char list
<!testsaved32BE-2
Compiled pattern loaded from testsaved32BE-2
@ -76,6 +76,6 @@ Options: extended utf
No first char
No need char
Subject length lower bound = 2
No set of starting bytes
No starting char list
/-- End of testinput22 --/

34
pcre/testdata/testoutput23

@ -18,7 +18,7 @@ Failed: character value in \x{} or \o{} is too large at offset 8
/[\H]/BZSI
------------------------------------------------------------------
Bra
[\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{ffff}]
[\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{ffff}]
Ket
End
------------------------------------------------------------------
@ -27,12 +27,25 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
\x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
\x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
: ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^
_ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80
\x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
\x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
\x9f \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
\xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
\xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
\xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
\xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
\xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
\xfa \xfb \xfc \xfd \xfe \xff
/[\V]/BZSI
------------------------------------------------------------------
Bra
[\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{ffff}]
[\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{ffff}]
Ket
End
------------------------------------------------------------------
@ -41,6 +54,19 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e
\x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
\x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = >
? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c
d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82
\x83 \x84 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
\x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
\xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
\xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
\xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
\xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
\xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
\xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
\xfc \xfd \xfe \xff
/-- End of testinput23 --/

36
pcre/testdata/testoutput25

@ -1,6 +1,6 @@
/-- Tests for the 32-bit library only */
< forbid 8w
< forbid 8W
/-- Check maximum character size --/
@ -65,7 +65,7 @@ Need char = \x{800000}
/[\H]/BZSI
------------------------------------------------------------------
Bra
[\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{ffffffff}]
[\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{ffffffff}]
Ket
End
------------------------------------------------------------------
@ -74,12 +74,25 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x0a \x0b
\x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a
\x1b \x1c \x1d \x1e \x1f ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
: ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^
_ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80
\x81 \x82 \x83 \x84 \x85 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f
\x90 \x91 \x92 \x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e
\x9f \xa1 \xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae
\xaf \xb0 \xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd
\xbe \xbf \xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc
\xcd \xce \xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb
\xdc \xdd \xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea
\xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9
\xfa \xfb \xfc \xfd \xfe \xff
/[\V]/BZSI
------------------------------------------------------------------
Bra
[\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{ffffffff}]
[\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{ffffffff}]
Ket
End
------------------------------------------------------------------
@ -88,6 +101,19 @@ No options
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0e
\x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19 \x1a \x1b \x1c \x1d
\x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = >
? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c
d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x7f \x80 \x81 \x82
\x83 \x84 \x86 \x87 \x88 \x89 \x8a \x8b \x8c \x8d \x8e \x8f \x90 \x91 \x92
\x93 \x94 \x95 \x96 \x97 \x98 \x99 \x9a \x9b \x9c \x9d \x9e \x9f \xa0 \xa1
\xa2 \xa3 \xa4 \xa5 \xa6 \xa7 \xa8 \xa9 \xaa \xab \xac \xad \xae \xaf \xb0
\xb1 \xb2 \xb3 \xb4 \xb5 \xb6 \xb7 \xb8 \xb9 \xba \xbb \xbc \xbd \xbe \xbf
\xc0 \xc1 \xc2 \xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce
\xcf \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd7 \xd8 \xd9 \xda \xdb \xdc \xdd
\xde \xdf \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 \xea \xeb \xec
\xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 \xf7 \xf8 \xf9 \xfa \xfb
\xfc \xfd \xfe \xff
/-- End of testinput25 --/

15
pcre/testdata/testoutput3

@ -1,7 +1,10 @@
/-- This set of tests checks local-specific features, using the fr_FR locale.
It is not Perl-compatible. There is different version called wintestinput3
f or use on Windows, where the locale is called "french". --/
/-- This set of tests checks local-specific features, using the "fr_FR" locale.
It is not Perl-compatible. When run via RunTest, the locale is edited to
be whichever of "fr_FR", "french", or "fr" is found to exist. There is
different version of this file called wintestinput3 for use on Windows,
where the locale is called "french" and the tests are run using
RunTest.bat. --/
< forbid 8W
/^[\w]+/
@ -90,7 +93,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfr_FR
@ -99,7 +102,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â
ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ

174
pcre/testdata/testoutput3A

@ -0,0 +1,174 @@
/-- This set of tests checks local-specific features, using the "fr_FR" locale.
It is not Perl-compatible. When run via RunTest, the locale is edited to
be whichever of "fr_FR", "french", or "fr" is found to exist. There is
different version of this file called wintestinput3 for use on Windows,
where the locale is called "french" and the tests are run using
RunTest.bat. --/
< forbid 8W
/^[\w]+/
*** Failers
No match
École
No match
/^[\w]+/Lfr_FR
École
0: École
/^[\w]+/
*** Failers
No match
École
No match
/^[\W]+/
École
0: \xc9
/^[\W]+/Lfr_FR
*** Failers
0: ***
École
No match
/[\b]/
\b
0: \x08
*** Failers
No match
a
No match
/[\b]/Lfr_FR
\b
0: \x08
*** Failers
No match
a
No match
/^\w+/
*** Failers
No match
École
No match
/^\w+/Lfr_FR
École
0: École
/(.+)\b(.+)/
École
0: \xc9cole
1: \xc9
2: cole
/(.+)\b(.+)/Lfr_FR
*** Failers
0: *** Failers
1: ***
2: Failers
École
No match
/École/i
École
0: \xc9cole
*** Failers
No match
école
No match
/École/iLfr_FR
École
0: École
école
0: école
/\w/IS
Capturing subpattern count = 0
No options
No first char
No need char
Subject length lower bound = 1
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfr_FR
Capturing subpattern count = 0
No options
No first char
No need char
Subject length lower bound = 1
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â
ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
/^[\xc8-\xc9]/iLfr_FR
École
0: É
école
0: é
/^[\xc8-\xc9]/Lfr_FR
École
0: É
*** Failers
No match
école
No match
/\W+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/[\W]+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/[^[:alpha:]]+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/\w+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[\w]+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[[:alpha:]]+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[[:alpha:]][[:lower:]][[:upper:]]/DZLfr_FR
------------------------------------------------------------------
Bra
[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\xff]
[a-z\xaa\xb5\xba\xdf-\xf6\xf8-\xff]
[A-Z\xc0-\xd6\xd8-\xde]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
No options
No first char
No need char
/-- End of testinput3 --/

174
pcre/testdata/testoutput3B

@ -0,0 +1,174 @@
/-- This set of tests checks local-specific features, using the "fr_FR" locale.
It is not Perl-compatible. When run via RunTest, the locale is edited to
be whichever of "fr_FR", "french", or "fr" is found to exist. There is
different version of this file called wintestinput3 for use on Windows,
where the locale is called "french" and the tests are run using
RunTest.bat. --/
< forbid 8W
/^[\w]+/
*** Failers
No match
École
No match
/^[\w]+/Lfr_FR
École
0: École
/^[\w]+/
*** Failers
No match
École
No match
/^[\W]+/
École
0: \xc9
/^[\W]+/Lfr_FR
*** Failers
0: ***
École
No match
/[\b]/
\b
0: \x08
*** Failers
No match
a
No match
/[\b]/Lfr_FR
\b
0: \x08
*** Failers
No match
a
No match
/^\w+/
*** Failers
No match
École
No match
/^\w+/Lfr_FR
École
0: École
/(.+)\b(.+)/
École
0: \xc9cole
1: \xc9
2: cole
/(.+)\b(.+)/Lfr_FR
*** Failers
0: *** Failers
1: ***
2: Failers
École
No match
/École/i
École
0: \xc9cole
*** Failers
No match
école
No match
/École/iLfr_FR
École
0: École
école
0: école
/\w/IS
Capturing subpattern count = 0
No options
No first char
No need char
Subject length lower bound = 1
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfr_FR
Capturing subpattern count = 0
No options
No first char
No need char
Subject length lower bound = 1
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â
ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
/^[\xc8-\xc9]/iLfr_FR
École
0: É
école
0: é
/^[\xc8-\xc9]/Lfr_FR
École
0: É
*** Failers
No match
école
No match
/\W+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/[\W]+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/[^[:alpha:]]+/Lfr_FR
>>>\xaa<<<
0: >>>
>>>\xba<<<
0: >>>
/\w+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[\w]+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[[:alpha:]]+/Lfr_FR
>>>\xaa<<<
0: ª
>>>\xba<<<
0: º
/[[:alpha:]][[:lower:]][[:upper:]]/DZLfr_FR
------------------------------------------------------------------
Bra
[A-Za-z\x83\x8a\x8c\x8e\x9a\x9c\x9e\x9f\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\xff]
[a-z\x83\x9a\x9c\x9e\xaa\xb5\xba\xdf-\xf6\xf8-\xff]
[A-Z\x8a\x8c\x8e\x9f\xc0-\xd6\xd8-\xde]
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
No options
No first char
No need char
/-- End of testinput3 --/

8
pcre/testdata/testoutput4

@ -1263,4 +1263,12 @@ No match
aa
0: aa
/^.\B.\B./8
\x{10123}\x{10124}\x{10125}
0: \x{10123}\x{10124}\x{10125}
/^#[^\x{ffff}]#[^\x{ffff}]#[^\x{ffff}]#/8
#\x{10000}#\x{100}#\x{10ffff}#
0: #\x{10000}#\x{100}#\x{10ffff}#
/-- End of testinput4 --/

33
pcre/testdata/testoutput5

@ -270,7 +270,7 @@ No match
/[z-\x{100}]/8DZ
------------------------------------------------------------------
Bra
[z-\x{100}]
[z-\xff\x{100}]
Ket
End
------------------------------------------------------------------
@ -812,7 +812,7 @@ No match
/[\H]/8BZ
------------------------------------------------------------------
Bra
[\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}]
[\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}]
Ket
End
------------------------------------------------------------------
@ -820,7 +820,7 @@ No match
/[\V]/8BZ
------------------------------------------------------------------
Bra
[\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}]
[\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}]
Ket
End
------------------------------------------------------------------
@ -1536,7 +1536,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/[^\x{1234}]+?/iS8I
Capturing subpattern count = 0
@ -1544,7 +1544,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/[^\x{1234}]++/iS8I
Capturing subpattern count = 0
@ -1552,7 +1552,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
No set of starting bytes
No starting char list
/[^\x{1234}]{2}/iS8I
Capturing subpattern count = 0
@ -1560,7 +1560,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 2
No set of starting bytes
No starting char list
//<bsr_anycrlf><bsr_unicode>
Failed: inconsistent NEWLINE options at offset 0
@ -1620,7 +1620,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\H\x{d7ff}]+/8BZ
------------------------------------------------------------------
Bra
[\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]++
[\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]++
Ket
End
------------------------------------------------------------------
@ -1660,7 +1660,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\V\x{d7ff}]+/8BZ
------------------------------------------------------------------
Bra
[\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]++
[\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]++
Ket
End
------------------------------------------------------------------
@ -1882,4 +1882,19 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 5
aa
0: aa
/[b-d\x{200}-\x{250}]*[ae-h]?#[\x{200}-\x{250}]{0,8}[\x00-\xff]*#[\x{200}-\x{250}]+[a-z]/8BZ
------------------------------------------------------------------
Bra
[b-d\x{200}-\x{250}]*+
[ae-h]?+
#
[\x{200}-\x{250}]{0,8}+
[\x00-\xff]*
#
[\x{200}-\x{250}]++
[a-z]
Ket
End
------------------------------------------------------------------
/-- End of testinput5 --/

12
pcre/testdata/testoutput6

@ -2445,4 +2445,16 @@ No match
\x{37e}
No match
/[RST]+/8iW
Ss\x{17f}
0: Ss\x{17f}
/[R-T]+/8iW
Ss\x{17f}
0: Ss\x{17f}
/[q-u]+/8iW
Ss\x{17f}
0: Ss\x{17f}
/-- End of testinput6 --/

28
pcre/testdata/testoutput7

@ -124,7 +124,7 @@ No match
/[z-\x{100}]/8iDZ
------------------------------------------------------------------
Bra
[Z\x{39c}\x{3bc}\x{1e9e}\x{178}z-\x{101}]
[Zz-\xff\x{39c}\x{3bc}\x{212b}\x{1e9e}\x{212b}\x{178}\x{100}-\x{101}]
Ket
End
------------------------------------------------------------------
@ -162,7 +162,7 @@ No match
/[z-\x{100}]/8DZi
------------------------------------------------------------------
Bra
[Z\x{39c}\x{3bc}\x{1e9e}\x{178}z-\x{101}]
[Zz-\xff\x{39c}\x{3bc}\x{212b}\x{1e9e}\x{212b}\x{178}\x{100}-\x{101}]
Ket
End
------------------------------------------------------------------
@ -2263,4 +2263,28 @@ No match
End
------------------------------------------------------------------
/[RST]+/8iWBZ
------------------------------------------------------------------
Bra
[R-Tr-t\x{17f}]++
Ket
End
------------------------------------------------------------------
/[R-T]+/8iWBZ
------------------------------------------------------------------
Bra
[R-Tr-t\x{17f}]++
Ket
End
------------------------------------------------------------------
/[Q-U]+/8iWBZ
------------------------------------------------------------------
Bra
[Q-Uq-u\x{17f}]++
Ket
End
------------------------------------------------------------------
/-- End of testinput7 --/

2
pcre/testdata/testoutput8

@ -7232,7 +7232,7 @@ No options
No first char
No need char
Subject length lower bound = 3
Starting byte set: a d x
Starting chars: a d x
terhjk;abcdaadsfe
0: abc
the quick xyz brown fox

4
pcre/testdata/wintestoutput3

@ -84,7 +84,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfrench
@ -93,7 +93,7 @@ No options
No first char
No need char
Subject length lower bound = 1
Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
ƒ Š Œ Ž š œ ž Ÿ ª ² ³ µ ¹ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö
Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý

Loading…
Cancel
Save