Comments (4)
Well, yes, the subpattern name IS compiled to a number, but during compiling there is set up a table to translate names to numbers. The table is also output at the start of the compiled pattern because the interpreter uses it to find all the numbers associated with a given name when doing condition testing. This all originates in PCRE1 when named subpatterns were added. No doubt if I were starting again from scratch it might be done differently. Anyway, I set up the table with fixed-length entries (the length of the longest name), and I chose a maximum length just in case some person or fuzzer feeds in a stupidly long name. I never expected anybody to use names longer than a few characters. It just goes to prove that second-guessing what people will do never works. There is a macro called MAX_NAME_SIZE that controls this. I would not object to increasing this to 64 or even 100.
from pcre2.
I opened this issue as I hit the limit when extending this https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/6e1f7837e4/src/DocBlock/TypeExpression.php#L83 complex regex for even more complex PHPDoc grammar.
Raising the limit to 100 would be great and it would allow to name the groups "more consistently based on the parsed grammar naming" - in the mentioned regex, I had to use callable_template_inner_d_types
instead of callable_template_inner_default_types
:).
from pcre2.
I have raised the limit to 128 in HEAD. There is unlikely to be another release for quite some time (10.43 being very recent). If you want to patch 10.43, note the that definition is in src/config.h, which is generated by autoconf from configure.ac.
from pcre2.
Thank you very much for making this great project perfect!
from pcre2.
Related Issues (20)
- `pcre2grep -M` with anchored pattern matches not on the whole input - or only once HOT 7
- Another recursion inconsistency corner case HOT 17
- Malformed pcre2demo(3) man page destroys apropos readability HOT 1
- Install fails with `INSTALL_MSVC_PDB=ON` and `-G "Visual Studio XXX"`
- On Linux, pages are marked as simultaneously writable and executable HOT 5
- New release/roadmap HOT 3
- ld.lld: error: undefined symbol: _pcre2_default_tables_8 HOT 1
- Allocation of a negative number of bytes HOT 3
- PCRE2_DISABLE_RECURSELOOP_CHECK missing in pcre2.h.generic HOT 2
- Loss of data warnings on Visual Studio HOT 3
- Website problem: http to https redirections do not configurated HOT 2
- Several old links on pcre.org website
- Old files on pcre.org HOT 2
- MSVC warnings with 10.43 HOT 1
- SunOS-5.11-SPARC - "src/pcre2.h", line 949: warning: no explicit type given HOT 5
- pcre2 makes software crash when GDS mitigation is forced for older CPUs HOT 22
- Invalid size 0 may lead to undefined behavior / infinite loop HOT 1
- Atomic group must not increase stack depth HOT 1
- Probable thread-safety issue in pcre2 10.43+ HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcre2.