GithubHelp home page GithubHelp logo

Comments (5)

zherczeg avatar zherczeg commented on July 17, 2024 1

If you using pcre_exec, that means you are using PCRE1, which is not maintained anymore, and it will never see another release. Anyway, the problem is not with pcre1, because PCRE2 also throws PCRE2_ERROR_MATCHLIMIT. This pattern is 2^n exponential pattern on this particular input because both \s and dot matches to space. To avoid long runs, the engine exits at some point.

Because '.|\s' essentially matches to all characters, you can simply enable dotall temporarily for the dot character: a(?s:.)*?asdf.

from pcre2.

michaeltyson avatar michaeltyson commented on July 17, 2024

๐Ÿคจ๐Ÿ˜„

from pcre2.

zherczeg avatar zherczeg commented on July 17, 2024

Let me know if you are ok with this answer because we can close this bug then.

from pcre2.

michaeltyson avatar michaeltyson commented on July 17, 2024

I suspect that's more in your court - this still feels like incorrect behaviour to me, but I don't think it's my place ๐Ÿ˜Š

And I'm fine with the workaround.

Thanks!

from pcre2.

zherczeg avatar zherczeg commented on July 17, 2024

Regex101 says: https://regex101.com/r/6XKrAV/1
Catastrophic backtracking has been detected and the execution of your expression has been halted. To find out more and what this is, please read the following article: Runaway Regular Expressions

Writing good patterns is important, the engine has limits to help you. E.g. a bubble sort is always much slower than a quick sort, whatever a C compiler does, and this is not the fault of the compiler.

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.