express icon indicating copy to clipboard operation
express copied to clipboard

chore: improve regexes in examples

Open ericcornelissen opened this issue 5 months ago • 0 comments

Improve a regular expression that appears twice in the examples which could lead to quadratic runtime if the input is crafted to match /\{+/ plus some rejecting suffix. In these examples this is unlikely since the markdown files are probably trusted. This change is mostly focused towards anyone that starts from the examples and expands to cases where the markdown files may not be trusted (i.e., user-provided templates).

Technically this changes the behavior of these examples, because names can no longer contain a {, but given they're just examples this "breaking change" seems acceptable to me.

ericcornelissen avatar Aug 04 '25 13:08 ericcornelissen