Comment

Comment by brey

as a server-side regex parser, how do you handle catastrophic backtracking?

http://www.regular-expressions.info/catastrophic.html

this seems to handle /(x+x+)+y/ and 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' gracefully - this should take exponential time (in the number of 'x's) to resolve.

edit: seems you don't ... PHP (PCRE) is fine (php handles this well?), javascript is presumably just using my own CPU, but selecting Python allows me to use arbitrary server CPU ... sorry about that ;)

edit2: HN comments tend to focus on the negative ... pathological input handling aside, I really like it.

parent brey 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton