6 ms·
You don't have to be an expert; you should very rarely be using regexes so complex that you can't understand them.
by da39a3ee 2y ago
You don't have to be an expert; you should very rarely be using regexes so complex that you can't understand them.
- zacmps 2y agoIt might not be obvious when you hit that point, bad regexes can be subtle, just see that old cloudflare postmortem.
- hnlmorg 2y ago...and if you can understand them then you clearly understand regex enough not to need ChatGPT to write them
- mnau 2y agoEven simple regexs can be problematic, e.g. Gitlab RCE bug through ExifTools https://devcraft.io/2021/05/04/exiftool-arbitrary-code-execution-cve-2021-22204.html https://devcraft.io/2021/05/04/exiftool-arbitrary-code-execu... > "a\ > "" > The second quote was not escaped because in the regex $tok =~ /(\\+)$/ the $ will match the end of a string, but also match before a newline at the end of a string, so the code thinks that the quote is being escaped when it’s escaping the newline.