philnash@programming.dev to Programming@programming.devEnglish · vor 1 JahrA comprehensive guide to the dangers of Regular Expressions in JavaScriptwww.sonarsource.comexternal-linkmessage-square15fedilinkarrow-up1107arrow-down12cross-posted to: regex@programming.devjavascript@programming.dev
arrow-up1105arrow-down1external-linkA comprehensive guide to the dangers of Regular Expressions in JavaScriptwww.sonarsource.comphilnash@programming.dev to Programming@programming.devEnglish · vor 1 Jahrmessage-square15fedilinkcross-posted to: regex@programming.devjavascript@programming.dev
minus-squaresebschlinkfedilinkarrow-up4arrow-down8·vor 1 JahrIs there one thing not screwed up in this language? I mean it’s regex, there are so many good implementations for it.
minus-squarephilnash@programming.devOPlinkfedilinkarrow-up5·vor 1 JahrJavaScript’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.
minus-squaresebschlinkfedilinkarrow-up1arrow-down4·vor 1 JahrOk 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?
minus-squareburntsushi@programming.devlinkfedilinkEnglisharrow-up3·vor 1 JahrBoth Perl and Python use backtracking regex engines and are thus susceptible to similar problems as discussed in the OP.
Is there one thing not screwed up in this language? I mean it’s regex, there are so many good implementations for it.
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.
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?
Both Perl and Python use backtracking regex engines and are thus susceptible to similar problems as discussed in the OP.