philnash@programming.dev to Programming@programming.devEnglish · 2 年前A comprehensive guide to the dangers of Regular Expressions in JavaScriptwww.sonarsource.comexternal-linkmessage-square15fedilinkarrow-up1105arrow-down12
arrow-up1103arrow-down1external-linkA comprehensive guide to the dangers of Regular Expressions in JavaScriptwww.sonarsource.comphilnash@programming.dev to Programming@programming.devEnglish · 2 年前message-square15fedilink
minus-squarephilnash@programming.devOPlinkfedilinkarrow-up5·2 年前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.
minus-squaresebsch@discuss.tchncs.delinkfedilinkarrow-up1arrow-down4·2 年前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?
minus-squareburntsushi@programming.devlinkfedilinkEnglisharrow-up3·2 年前Both Perl and Python use backtracking regex engines and are thus susceptible to similar problems as discussed in the OP.
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.