GithubHelp home page GithubHelp logo

Comments (4)

PhilipHazel avatar PhilipHazel commented on August 17, 2024 2

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.

mvorisek avatar mvorisek commented on August 17, 2024

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.

PhilipHazel avatar PhilipHazel commented on August 17, 2024

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.

mvorisek avatar mvorisek commented on August 17, 2024

Thank you very much for making this great project perfect!

from pcre2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.