-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade module re from PCRE to PCRE2 #9299
Open
sverker
wants to merge
21
commits into
erlang:master
Choose a base branch
from
sverker:sverker/re-pcre2/OTP-19431
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+79,732
−77,167
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run_pcre_tests.erl: * Improve handling of rejected options to support multi-char options. * Add options aftertext, mark, dupnames * Ignore "MK:" as we don't support return of "marks". * Ignore option xx (PCRE2_EXTENDED_MORE) * Skip comments # and \= * Modernize catch -> try catch * Fix escaping in expected match result https://www.pcre.org/current/doc/html/pcre2test.html#SEC17 says "...bytes other than 32-126 are always treated as non-printing characters and are therefore shown as hex escapes." And this seems to mean that printable characters are never escaped, so for example "\x3b" is verbatim and does not mean ";". * Fix new subject modifier syntax where the subject string can end with something like \=anchored,notbol Old New \A anchored \B notbol \>1 offset=1 Todo: Could ovector= be converted to re:run option {capture, ..} * Repeated string syntax Ex: "\[abc]{4}" is "abcabcabcabc" * Improve repl and skip generation
Perl version 5.34.0 was used. The default installed on ELX 6 Ubuntu 22.04.5 LTS.
I give up. This is such a contrived test. I doubt there even is a sane result that anyone would expect.
Does not compile on PCRE. It says "an argument is not allowed for (*ACCEPT), (*FAIL), or (*COMMIT)" Difference in PCRE2 10.44 vs perl 5.34.0 Perl matches "axabc" as "a(*COMMIT)b" PCRE2 does not match.
Does no compile on PCRE. It says "lookbehind assertion is not fixed length" Difference in PCRE2 10.44 vs perl 5.34.0 Perl complains on stderr: "Variable length lookbehind is experimental in regex..." and returns strange match results.
initial version
Same fail with old pcre. I think our own implementation of option 'global' is to blame.
from commit 2530d5c5fc9056bdf7f63c8e6b9ae198324468ed in pcre2 repo. And removed old pcre files.
CT Test Results 4 files 226 suites 1h 53m 2s ⏱️ Results for commit a4ca4b0. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
A better solution would be to silence these warnings in particular somehow: warning: ‘heapframes_size’ may be used uninitialized in this function warning: ‘frame_size’ may be used uninitialized in this function warning: ‘bumpalong_limit’ may be used uninitialized in this function :
sverker
force-pushed
the
sverker/re-pcre2/OTP-19431
branch
from
January 15, 2025 20:26
afa341d
to
a4beeba
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is done primarily for long term maintenance reasons. The old PCRE is no longer maintained and has been replaced by PCRE2 which is mostly backward compatible with PCRE wrt regular expression syntax.