2014-05-13 13:20:03 +02:00
|
|
|
MAINTENANCE README FOR PCRE2
|
|
|
|
============================
|
|
|
|
|
|
|
|
The files in the "maint" directory of the PCRE2 source contain data, scripts,
|
|
|
|
and programs that are used for the maintenance of PCRE2, but which do not form
|
|
|
|
part of the PCRE2 distribution tarballs. This document describes these files
|
|
|
|
and also contains some notes for maintainers. Its contents are:
|
|
|
|
|
|
|
|
Files in the maint directory
|
|
|
|
Updating to a new Unicode release
|
|
|
|
Preparing for a PCRE2 release
|
|
|
|
Making a PCRE2 release
|
|
|
|
Long-term ideas (wish list)
|
|
|
|
|
|
|
|
|
|
|
|
Files in the maint directory
|
|
|
|
============================
|
|
|
|
|
2021-12-26 18:49:58 +01:00
|
|
|
GenerateCommon.py
|
|
|
|
A Python module containing data and functions that are used by the other
|
2021-12-31 17:59:44 +01:00
|
|
|
Generate scripts.
|
|
|
|
|
|
|
|
GenerateTest26.py
|
|
|
|
A Python script that generates input and expected output test data for test
|
|
|
|
26, which tests Unicode property support.
|
2021-12-26 18:49:58 +01:00
|
|
|
|
|
|
|
GenerateUcd.py
|
|
|
|
A Python script that generates the file pcre2_ucd.c from GenerateCommon.py
|
|
|
|
and Unicode data files, which are themselves downloaded from the Unicode web
|
|
|
|
site. The generated file contains the tables for a 2-stage lookup of Unicode
|
|
|
|
properties, along with some auxiliary tables.
|
|
|
|
|
|
|
|
GenerateUcpHeader.py
|
|
|
|
A Python script that generates the file pcre2_ucp.h from GenerateCommon.py
|
|
|
|
and Unicode data files. The generated file defines constants for various
|
|
|
|
Unicode property values.
|
|
|
|
|
|
|
|
GenerateUcpTables.py
|
|
|
|
A Python script that generates the file pcre2_ucptables.c from
|
|
|
|
GenerateCommon.py and Unicode data files. The generated file contains tables
|
|
|
|
for looking up Unicode properties.
|
|
|
|
|
|
|
|
ManyConfigTests
|
|
|
|
A shell script that runs "configure, make, test" a number of times with
|
|
|
|
different configuration settings.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
pcre2_chartables.c.non-standard
|
2021-12-26 18:49:58 +01:00
|
|
|
This is a set of character tables that came from a Windows system. It has
|
|
|
|
characters greater than 128 that are set as spaces, amongst other things. I
|
|
|
|
kept it so that it can be used for testing from time to time.
|
|
|
|
|
|
|
|
README
|
|
|
|
This file.
|
|
|
|
|
|
|
|
Unicode.tables
|
|
|
|
The files in this directory were downloaded from the Unicode web site. They
|
|
|
|
contain information about Unicode characters and scripts, and are used by the
|
|
|
|
Generate scripts. There is also UnicodeData.txt, which is no longer used by
|
|
|
|
any script, because it is useful occasionally for manually looking up the
|
|
|
|
details of certain characters. However, note that character names in this
|
|
|
|
file such as "Arabic sign sanah" do NOT mean that the character is in a
|
|
|
|
particular script (in this case, Arabic). Scripts.txt and
|
|
|
|
ScriptExtensions.txt are where to look for script information.
|
|
|
|
|
|
|
|
ucptest.c
|
|
|
|
A short C program for testing the Unicode property macros that do lookups in
|
|
|
|
the pcre2_ucd.c data, mainly useful after rebuilding the Unicode property
|
|
|
|
table. Compile and run this in the "maint" directory (see comments at its
|
|
|
|
head). This program can also be used to find characters with specific
|
|
|
|
properties.
|
|
|
|
|
|
|
|
ucptestdata
|
|
|
|
A directory containing four files, testinput{1,2} and testoutput{1,2}, for
|
|
|
|
use in conjunction with the ucptest program.
|
|
|
|
|
|
|
|
utf8.c
|
|
|
|
A short, freestanding C program for converting a Unicode code point into a
|
|
|
|
sequence of bytes in the UTF-8 encoding, and vice versa. If its argument is a
|
|
|
|
hex number such as 0x1234, it outputs a list of the equivalent UTF-8 bytes.
|
|
|
|
If its argument is a sequence of concatenated UTF-8 bytes (e.g. e188b4) it
|
|
|
|
treats them as a UTF-8 character and outputs the equivalent code point in
|
|
|
|
hex. See comments at its head for details.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
Updating to a new Unicode release
|
|
|
|
=================================
|
|
|
|
|
2022-01-07 11:21:09 +01:00
|
|
|
**** WORK IN PROGRESS ****
|
|
|
|
|
|
|
|
Work is going on in the area of Unicode property handling. What follows here is
|
|
|
|
now out-of-date. It will be updated once the current project is complete.
|
|
|
|
Updating to any new Unicode release is best left till then also.
|
|
|
|
06-January-2022
|
|
|
|
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
When there is a new release of Unicode, the files in Unicode.tables must be
|
|
|
|
refreshed from the web site. If the new version of Unicode adds new character
|
2021-12-26 18:49:58 +01:00
|
|
|
scripts, the lists in GenerateCommon.py must be updated. I have been adding
|
|
|
|
each new group at the end of the relevant list, with a comment.
|
|
|
|
|
|
|
|
NOTE: Both the pcre2syntax.3 and pcre2pattern.3 man pages contain lists of
|
|
|
|
supported Unicode scripts that also have to be updated. These lists are in
|
|
|
|
alphabetical order.
|
|
|
|
|
|
|
|
There are two lists in GenerateCommon.py: the full names and the abbreviations
|
|
|
|
that are found in the ScriptExtensions.txt file. A list of script names and
|
|
|
|
their abbreviations can be found in the PropertyValueAliases.txt file on the
|
2018-10-07 18:29:51 +02:00
|
|
|
Unicode web site. There is also a Wikipedia page that lists them, and notes the
|
|
|
|
Unicode version in which they were introduced:
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2020-03-25 18:18:33 +01:00
|
|
|
https://en.wikipedia.org/wiki/Unicode_scripts#Table_of_Unicode_scripts
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2021-12-26 18:49:58 +01:00
|
|
|
Once the script name lists have been updated, the three generator scripts can
|
|
|
|
be run from within the maint directory. If you get the error "ValueError:
|
|
|
|
list.index(x): x not in list", the cause is usually a missing (or misspelt)
|
|
|
|
name in one of the lists. You can give an output file name as an argument, but
|
|
|
|
by default:
|
|
|
|
|
|
|
|
GenerateUcd.py creates pcre2_ucd.c )
|
|
|
|
GenerateUcpHeader.py creates pcre2_ucp.h ) in the current directory
|
|
|
|
GenerateUcpTables.py creates pcre2_ucptables.c )
|
|
|
|
|
|
|
|
These files can be compared against the existing versions in the src directory
|
|
|
|
to check on any changes before replacing the old files, but you can generate
|
|
|
|
directly into the final location by running
|
|
|
|
|
|
|
|
./GenerateUcd.py ../src/pcre2_ucd.c
|
|
|
|
./GenerateUcpHeader.py ../src/pcre2_ucp.h
|
|
|
|
./GenerateUcpTables.py ../src/pcre2_ucptables.c
|
2018-10-07 18:29:51 +02:00
|
|
|
|
2021-12-26 18:49:58 +01:00
|
|
|
The ucptest program can be compiled and used to check that the new tables work
|
|
|
|
properly, using the data files in ucptestdata to check a number of test
|
|
|
|
characters. See the comments at the start of ucptest.c. If there are new
|
|
|
|
scripts, adding a few tests to the files in ucptestdata is a good idea.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2021-12-31 17:59:44 +01:00
|
|
|
Finally, you should run the GenerateTest26.py script to regenerate new versions
|
|
|
|
of the input and expected output from a series of Unicode property tests that
|
|
|
|
are automatically generated from the Unicode data files. By default, the files
|
|
|
|
are written to testinput26 and testoutput26 in the current directory, but you
|
|
|
|
can give an alternative directory name as an argument to the script. These
|
|
|
|
files should eventually be installed in the main testdata directory.
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
Preparing for a PCRE2 release
|
|
|
|
=============================
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
This section contains a checklist of things that I consult before building a
|
|
|
|
distribution for a new release.
|
|
|
|
|
|
|
|
. Ensure that the version number and version date are correct in configure.ac.
|
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Update the library version numbers in configure.ac according to the rules
|
2014-05-13 13:20:03 +02:00
|
|
|
given below.
|
|
|
|
|
2015-12-15 13:07:41 +01:00
|
|
|
. If new build options or new source files have been added, ensure that they
|
|
|
|
are added to the CMake files as well as to the autoconf files. The relevant
|
|
|
|
files are CMakeLists.txt and config-cmake.h.in. After making a release
|
|
|
|
tarball, test it out with CMake if there have been changes here.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
. Run ./autogen.sh to ensure everything is up-to-date.
|
|
|
|
|
|
|
|
. Compile and test with many different config options, and combinations of
|
|
|
|
options. Also, test with valgrind by running "RunTest valgrind" and
|
|
|
|
"RunGrepTest valgrind" (which takes quite a long time). The script
|
|
|
|
maint/ManyConfigTests now encapsulates this testing. It runs tests with
|
|
|
|
different configurations, and it also runs some of them with valgrind, all of
|
|
|
|
which can take quite some time.
|
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
. Run tests in both 32-bit and 64-bit environments if possible. I can no longer
|
|
|
|
run 32-bit tests.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
2017-05-20 18:25:29 +02:00
|
|
|
. Run tests with two or more different compilers (e.g. clang and gcc), and
|
|
|
|
make use of -fsanitize=address and friends where possible. For gcc,
|
|
|
|
-fsanitize=undefined -std=gnu99 picks up undefined behaviour at runtime, but
|
|
|
|
needs -fno-sanitize=shift to get rid of warnings for shifts of negative
|
|
|
|
numbers in the JIT compiler. For clang, -fsanitize=address,undefined,integer
|
|
|
|
can be used but -fno-sanitize=alignment,shift,unsigned-integer-overflow must
|
|
|
|
be added when compiling with JIT. Another useful clang option is
|
|
|
|
-fsanitize=signed-integer-overflow
|
2015-12-15 13:07:41 +01:00
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
. Do a test build using CMake. Remove src/config.h first, lest it override the
|
|
|
|
version that CMake creates. Do NOT use parallel make.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Run perltest.sh on the test data for tests 1 and 4. The output should match
|
2014-10-25 17:51:01 +02:00
|
|
|
the PCRE2 test output, apart from the version identification at the start of
|
2019-06-03 18:39:20 +02:00
|
|
|
each test. Sometimes there are other differences in test 4 if PCRE2 and Perl
|
|
|
|
are using different Unicode releases. The other tests are not Perl-compatible
|
|
|
|
(they use various PCRE2-specific features or options).
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
. It is possible to test with the emulated memmove() function by undefining
|
2018-08-13 13:00:47 +02:00
|
|
|
HAVE_MEMMOVE and HAVE_BCOPY in config.h, though I do not do this often.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Documentation: check AUTHORS, ChangeLog (check version and date), LICENCE,
|
2014-05-13 13:20:03 +02:00
|
|
|
NEWS (check version and date), NON-AUTOTOOLS-BUILD, and README. Many of these
|
|
|
|
won't need changing, but over the long term things do change.
|
|
|
|
|
|
|
|
. I used to test new releases myself on a number of different operating
|
2015-12-15 13:07:41 +01:00
|
|
|
systems. For example, on Solaris it is helpful to test using Sun's cc
|
|
|
|
compiler as a change from gcc. Adding -xarch=v9 to the cc options does a
|
|
|
|
64-bit test, but it also needs -S 64 for pcre2test to increase the stack size
|
2019-06-03 18:39:20 +02:00
|
|
|
for test 2. Since I retired I can no longer do much of this, but instead I
|
2021-08-26 17:10:11 +02:00
|
|
|
rely on putting out release candidates for testing by the community.
|
2014-11-26 17:51:53 +01:00
|
|
|
|
2014-10-25 17:51:01 +02:00
|
|
|
. The buildbots at http://buildfarm.opencsw.org/ do some automated testing
|
2014-11-26 17:51:53 +01:00
|
|
|
of PCRE2 and should be checked before putting out a release.
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
Updating version info for libtool
|
|
|
|
=================================
|
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
This set of rules for updating library version information came from a web page
|
2014-05-13 13:20:03 +02:00
|
|
|
whose URL I have forgotten. The version information consists of three parts:
|
|
|
|
(current, revision, age).
|
|
|
|
|
|
|
|
1. Start with version information of 0:0:0 for each libtool library.
|
|
|
|
|
|
|
|
2. Update the version information only immediately before a public release of
|
|
|
|
your software. More frequent updates are unnecessary, and only guarantee
|
|
|
|
that the current interface number gets larger faster.
|
|
|
|
|
|
|
|
3. If the library source code has changed at all since the last update, then
|
|
|
|
increment revision; c:r:a becomes c:r+1:a.
|
|
|
|
|
|
|
|
4. If any interfaces have been added, removed, or changed since the last
|
|
|
|
update, increment current, and set revision to 0.
|
|
|
|
|
|
|
|
5. If any interfaces have been added since the last public release, then
|
|
|
|
increment age.
|
|
|
|
|
|
|
|
6. If any interfaces have been removed or changed since the last public
|
|
|
|
release, then set age to 0.
|
|
|
|
|
|
|
|
The following explanation may help in understanding the above rules a bit
|
|
|
|
better. Consider that there are three possible kinds of reaction from users to
|
|
|
|
changes in a shared library:
|
|
|
|
|
|
|
|
1. Programs using the previous version may use the new version as a drop-in
|
|
|
|
replacement, and programs using the new version can also work with the
|
|
|
|
previous one. In other words, no recompiling nor relinking is needed. In
|
|
|
|
this case, increment revision only, don't touch current or age.
|
|
|
|
|
|
|
|
2. Programs using the previous version may use the new version as a drop-in
|
|
|
|
replacement, but programs using the new version may use APIs not present in
|
|
|
|
the previous one. In other words, a program linking against the new version
|
|
|
|
may fail if linked against the old version at run time. In this case, set
|
|
|
|
revision to 0, increment current and age.
|
|
|
|
|
|
|
|
3. Programs may need to be changed, recompiled, relinked in order to use the
|
|
|
|
new version. Increment current, set revision and age to 0.
|
|
|
|
|
|
|
|
|
2014-10-25 17:51:01 +02:00
|
|
|
Making a PCRE2 release
|
|
|
|
======================
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
Run PrepareRelease and commit the files that it changes. The first thing this
|
|
|
|
script does is to run CheckMan on the man pages; if it finds any markup errors,
|
|
|
|
it reports them and then aborts. Otherwise it removes trailing spaces from
|
|
|
|
sources and refreshes the HTML documentation. Update the GitHub repository with
|
|
|
|
"git push".
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
Once PrepareRelease has run clean, run "make distcheck" to create the tarball
|
|
|
|
and the zipball. I then sign these files. Double-check with "git status" that
|
|
|
|
the repository is fully up-to-date, then create a new tag on GitHub. Upload the
|
|
|
|
tarball, zipball, and the signatures as "assets" of the GitHub release.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-10-25 17:51:01 +02:00
|
|
|
When the new release is out, don't forget to tell webmaster@pcre.org and the
|
2021-08-26 17:10:11 +02:00
|
|
|
mailing list.
|
2021-08-21 18:22:53 +02:00
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
Future ideas (wish list)
|
|
|
|
========================
|
|
|
|
|
|
|
|
This section records a list of ideas so that they do not get forgotten. They
|
|
|
|
vary enormously in their usefulness and potential for implementation. Some are
|
2021-08-26 17:10:11 +02:00
|
|
|
very sensible; some are rather wacky. Some have been on this list for many
|
|
|
|
years.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
. Optimization
|
|
|
|
|
|
|
|
There are always ideas for new optimizations so as to speed up pattern
|
|
|
|
matching. Most of them try to save work by recognizing a non-match without
|
|
|
|
having to scan all the possibilities. These are some that I've recorded:
|
|
|
|
|
|
|
|
* /((A{0,5}){0,5}){0,5}(something complex)/ on a non-matching string is very
|
|
|
|
slow, though Perl is fast. Can we speed up somehow? Convert to {0,125}?
|
|
|
|
OTOH, this is pathological - the user could easily fix it.
|
|
|
|
|
|
|
|
* Turn ={4} into ==== ? (for speed). I once did an experiment, and it seems
|
|
|
|
to have little effect, and maybe makes things worse.
|
|
|
|
|
|
|
|
* "Ends with literal string" - note that a single character doesn't gain much
|
2014-10-25 17:51:01 +02:00
|
|
|
over the existing "required code unit" feature that just remembers one code
|
|
|
|
unit.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-11-18 19:32:12 +01:00
|
|
|
* Remember an initial string rather than just 1 code unit.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
* A required code unit from alternatives - not just the last unit, but an
|
|
|
|
earlier one if common to all alternatives.
|
|
|
|
|
2014-11-18 19:32:12 +01:00
|
|
|
* Friedl contains other ideas.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
* The code does not set initial code unit flags for Unicode property types
|
|
|
|
such as \p; I don't know how much benefit there would be for, for example,
|
|
|
|
setting the bits for 0-9 and all values >= xC0 (in 8-bit mode) when a
|
|
|
|
pattern starts with \p{N}.
|
|
|
|
|
|
|
|
. If Perl gets to a consistent state over the settings of capturing sub-
|
|
|
|
patterns inside repeats, see if we can match it. One example of the
|
2014-11-18 19:32:12 +01:00
|
|
|
difference is the matching of /(main(O)?)+/ against mainOmain, where PCRE2
|
|
|
|
leaves $2 set. In Perl, it's unset. Changing this in PCRE2 will be very hard
|
2014-05-13 13:20:03 +02:00
|
|
|
because I think it needs much more state to be remembered.
|
|
|
|
|
|
|
|
. A feature to suspend a match via a callout was once requested.
|
|
|
|
|
2014-11-18 19:32:12 +01:00
|
|
|
. An option to convert results into character offsets and character lengths.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
. A (non-Unix) user wanted pcregrep options to (a) list a file name just once,
|
|
|
|
preceded by a blank line, instead of adding it to every matched line, and (b)
|
|
|
|
support --outputfile=name.
|
|
|
|
|
|
|
|
. Define a union for the results from pcre2_pattern_info().
|
|
|
|
|
|
|
|
. Provide a "random access to the subject" facility so that the way in which it
|
2014-10-25 17:51:01 +02:00
|
|
|
is stored is independent of PCRE2. For efficiency, it probably isn't possible
|
|
|
|
to switch this dynamically. It would have to be specified when PCRE2 was
|
|
|
|
compiled. PCRE2 would then call a function every time it wanted a character.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2019-06-03 18:39:20 +02:00
|
|
|
. pcre2grep: add -rs for a sorted recurse. Having to store file names and sort
|
2014-05-13 13:20:03 +02:00
|
|
|
them will of course slow it down.
|
|
|
|
|
|
|
|
. Someone suggested --disable-callout to save code space when callouts are
|
|
|
|
never wanted. This seems rather marginal.
|
|
|
|
|
|
|
|
. A user suggested a parameter to limit the length of string matched, for
|
|
|
|
example if the parameter is N, the current match should fail if the matched
|
|
|
|
substring exceeds N. This could apply to both match functions. The value
|
2015-12-15 13:07:41 +01:00
|
|
|
could be a new field in the match context. Compare the offset_limit feature,
|
|
|
|
which limits where a match must start.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Write a function that generates random matching strings for a compiled
|
2014-10-25 17:51:01 +02:00
|
|
|
pattern.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-10-25 17:51:01 +02:00
|
|
|
. Pcre2grep: an option to specify the output line separator, either as a string
|
2014-11-18 19:32:12 +01:00
|
|
|
or select from a fixed list. This is not straightforward, because at the
|
|
|
|
moment it outputs whatever is in the input file.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Improve the code for duplicate checking in pcre2_dfa_match(). An incomplete,
|
2014-05-13 13:20:03 +02:00
|
|
|
non-thread-safe patch showed that this can help performance for patterns
|
|
|
|
where there are many alternatives. However, a simple thread-safe
|
|
|
|
implementation that I tried made things worse in many simple cases, so this
|
|
|
|
is not an obviously good thing.
|
|
|
|
|
2014-10-25 17:51:01 +02:00
|
|
|
. PCRE2 cannot at present distinguish between subpatterns with different names,
|
2014-05-13 13:20:03 +02:00
|
|
|
but the same number (created by the use of ?|). In order to do so, a way of
|
2021-08-26 17:10:11 +02:00
|
|
|
remembering *which* subpattern numbered n matched is needed. (*MARK) can
|
|
|
|
perhaps be used as a way round this problem. However, note that Perl does not
|
|
|
|
distinguish: like PCRE2, a name is just an alias for a number in Perl.
|
2014-05-13 13:20:03 +02:00
|
|
|
|
|
|
|
. Instead of having #ifdef HAVE_CONFIG_H in each module, put #include
|
|
|
|
"something" and the the #ifdef appears only in one place, in "something".
|
|
|
|
|
2014-11-26 17:51:53 +01:00
|
|
|
. Implement something like (?(R2+)... to check outer recursions.
|
|
|
|
|
|
|
|
. If Perl ever supports the POSIX notation [[.something.]] PCRE2 should try
|
|
|
|
to follow.
|
|
|
|
|
2015-12-15 13:07:41 +01:00
|
|
|
. A user wanted a way of ignoring all Unicode "mark" characters so that, for
|
2019-06-03 18:39:20 +02:00
|
|
|
example "a" followed by an accent would, together, match "a". This can only
|
|
|
|
be done clumsily at present by using a lookahead such as /(?=a)\X/, which
|
|
|
|
works for "combining" characters.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
2019-06-03 18:39:20 +02:00
|
|
|
. Perl supports [\N{x}-\N{y}] as a Unicode range, even in EBCDIC. PCRE2
|
2018-08-23 18:53:45 +02:00
|
|
|
supports \N{U+dd..} everywhere, but not in EBCDIC.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
|
|
|
. Unicode stuff from Perl:
|
|
|
|
|
|
|
|
\b{gcb} or \b{g} grapheme cluster boundary
|
|
|
|
\b{sb} sentence boundary
|
|
|
|
\b{wb} word boundary
|
|
|
|
|
2018-08-23 18:53:45 +02:00
|
|
|
See Unicode TR 29. The last two are very much aimed at natural language.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
|
|
|
. (?[...]) extended classes: big project.
|
|
|
|
|
|
|
|
. Allow a callout to specify a number of characters to skip. This can be done
|
|
|
|
compatibly via an extra callout field.
|
|
|
|
|
|
|
|
. Allow callouts to return *PRUNE, *COMMIT, *THEN, *SKIP, with and without
|
|
|
|
continuing (that is, with and without an implied *FAIL). A new option,
|
|
|
|
PCRE2_CALLOUT_EXTENDED say, would be needed. This is unlikely ever to be
|
|
|
|
implemented by JIT, so this could be an option for pcre2_match().
|
|
|
|
|
|
|
|
. A limit on substitutions: a user suggested somehow finding a way of making
|
|
|
|
match_limit apply to the whole operation instead of each match separately.
|
|
|
|
|
2017-05-20 18:25:29 +02:00
|
|
|
. Some #defines could be replaced with enums to improve robustness.
|
2015-12-15 13:07:41 +01:00
|
|
|
|
2019-06-03 18:39:20 +02:00
|
|
|
. There was a request for an option for pcre2_match() to return the longest
|
2018-08-23 18:53:45 +02:00
|
|
|
match. This would mean searching for all possible matches, of course.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. Perl's /a modifier sets Unicode, but restricts \d etc to ASCII characters,
|
2018-08-23 18:53:45 +02:00
|
|
|
which is the PCRE2 default for PCRE2_UTF (use PCRE2_UCP to change). However,
|
|
|
|
Perl also has /aa, which in addition, disables ASCII/non-ASCII caseless
|
2019-06-03 18:39:20 +02:00
|
|
|
matching. Perhaps we need a new option PCRE2_CASELESS_RESTRICT_ASCII. In
|
2018-08-23 18:53:45 +02:00
|
|
|
practice, this just means not using the ucd_caseless_sets[] table.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. There is more that could be done to the oss-fuzz setup (needs some research).
|
|
|
|
A seed corpus could be built. I noted something about $LIB_FUZZING_ENGINE.
|
2018-08-23 18:53:45 +02:00
|
|
|
The test function could make use of get_substrings() to cover more code.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. A neater way of handling recursion file names in pcre2grep, e.g. a single
|
2021-08-26 17:10:11 +02:00
|
|
|
buffer that can grow. See also GitHub issue #2 (recursion looping via
|
|
|
|
symlinks).
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. A user suggested that before/after parameters in pcre2grep could have
|
|
|
|
negative values, to list lines near to the matched line, but not necessarily
|
|
|
|
the line itself. For example, --before-context=-1 would list the line *after*
|
2018-08-23 18:53:45 +02:00
|
|
|
each matched line, without showing the matched line. The problem here is what
|
2019-06-03 18:39:20 +02:00
|
|
|
to do with matches that are close together. Maybe a simpler way would be a
|
2018-08-23 18:53:45 +02:00
|
|
|
flag to disable showing matched lines, only valid with either -A or -B?
|
2019-06-03 18:39:20 +02:00
|
|
|
|
2018-08-23 18:53:45 +02:00
|
|
|
. There was a suggestiong for a pcre2grep colour default, or possibly a more
|
2019-06-03 18:39:20 +02:00
|
|
|
general PCRE2GREP_OPT, but only for some options - not file names or patterns.
|
2018-08-23 18:53:45 +02:00
|
|
|
|
2019-06-03 18:39:20 +02:00
|
|
|
. Breaking loops that match an empty string: perhaps find a way of continuing
|
2018-08-23 18:53:45 +02:00
|
|
|
if *something* has changed, but this might mean remembering additional data.
|
2019-06-03 18:39:20 +02:00
|
|
|
"Something" could be a capture value, but then a list of previous values
|
2021-08-26 17:10:11 +02:00
|
|
|
would be needed to avoid a cycle of changes.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. If a function could be written to find 3-character (or other length) fixed
|
2018-08-23 18:53:45 +02:00
|
|
|
strings, at least one of which must be present for a match, efficient
|
|
|
|
pre-searching of large datasets could be implemented.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. If pcre2grep had --first-line (match only in the first line) it could be
|
2018-08-23 18:53:45 +02:00
|
|
|
efficiently used to find files "starting with xxx". What about --last-line?
|
2021-08-26 17:10:11 +02:00
|
|
|
There was also the suggestion of an option for pcre2grep to scan only the
|
|
|
|
start of a file. I am not keen - this is the job of "head".
|
2019-06-03 18:39:20 +02:00
|
|
|
|
2018-08-23 18:53:45 +02:00
|
|
|
. A user requested a means of determining whether a failed match was failed by
|
2019-06-03 18:39:20 +02:00
|
|
|
the start-of-match optimizations, or by running the match engine. Easy enough
|
2018-08-23 18:53:45 +02:00
|
|
|
to define a bit in the match data, but all three matchers would need work.
|
2019-06-03 18:39:20 +02:00
|
|
|
|
|
|
|
. Would inlining "simple" recursions provide a useful performance boost for the
|
|
|
|
interpreters? JIT already does some of this, but it may not be worth it for
|
|
|
|
the interpreters.
|
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
. Redesign handling of class/nclass/xclass because the compile code logic is
|
|
|
|
currently very contorted and obscure. Also there was a request for a way of
|
|
|
|
re-defining \w (and therefore \W, \b, and \B). An in-pattern sequence such as
|
|
|
|
(?w=[...]) was suggested. Easiest way would be simply to inline the class,
|
|
|
|
with lookarounds for \b and \B. Ideally the setting should last till the end
|
|
|
|
of the group, which means remembering all previous settings; maybe a fixed
|
|
|
|
amount of stack would do - how deep would anyone want to nest these things?
|
|
|
|
See GitHub issue #13 for a compendium of character class issues.
|
2018-08-23 18:53:45 +02:00
|
|
|
|
2019-06-03 18:39:20 +02:00
|
|
|
. Recognize the short script names. They are already listed in maint/
|
|
|
|
Multistage2.py because they are needed for scanning the script extensions
|
|
|
|
file.
|
|
|
|
|
|
|
|
. Use script extensions for \p?
|
|
|
|
|
|
|
|
. A user suggested something like --with-build-info to set a build information
|
|
|
|
string that could be retrieved by pcre2_config(). However, there's no
|
|
|
|
facility for a length limit in pcre2_config(), and what would be the
|
|
|
|
encoding?
|
|
|
|
|
2021-08-26 17:10:11 +02:00
|
|
|
. Quantified groups with a fixed count currently operate by replicating the
|
|
|
|
group in the compiled bytecode. This may not really matter in these days of
|
|
|
|
gigabyte memory, but perhaps another implementation might be considered.
|
|
|
|
Needs coordination between the interpreters and JIT.
|
|
|
|
|
|
|
|
. There are regular requests for variable-length lookbehinds.
|
|
|
|
|
|
|
|
. See also any suggestions in the GitHub issues.
|
|
|
|
|
2014-05-13 13:20:03 +02:00
|
|
|
Philip Hazel
|
2021-08-26 17:10:11 +02:00
|
|
|
Email local part: Philip.Hazel
|
|
|
|
Email domain: gmail.com
|
2021-12-31 17:59:44 +01:00
|
|
|
Last updated: 31 December 2021
|