• sebsch
    link
    fedilink
    arrow-up
    4
    arrow-down
    8
    ·
    vor 1 Jahr

    Is there one thing not screwed up in this language? I mean it’s regex, there are so many good implementations for it.

    • philnash@programming.devOP
      link
      fedilink
      arrow-up
      5
      ·
      vor 1 Jahr

      JavaScript’s regex engine isn’t the only one to have these problems. There certainly are other implementations, like Re2 and Rust’s implementation, that don’t have this issue. But they also lack some of the features of the JS implementation too.

      • sebsch
        link
        fedilink
        arrow-up
        1
        arrow-down
        4
        ·
        vor 1 Jahr

        Ok thanks for the clarification.

        I would argue, the gold standard of regex would be perlre or even re from python. I never heard one discouraging using them. Do you know sth I don’t?

        • burntsushi@programming.dev
          link
          fedilink
          English
          arrow-up
          3
          ·
          vor 1 Jahr

          Both Perl and Python use backtracking regex engines and are thus susceptible to similar problems as discussed in the OP.