Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It would be easy to create a regex that consumes a lot of CPU power. It's very difficult to vet a regex in an automated fashion.


Then don't vet it. Just run it as is, and limit how many local resources it can consume (CPU cycles and RAM). Then add on a timeout for good measure, and you are good to go.


Alternatively, where possible, use a regular expression engine that does not have that issue: https://swtch.com/~rsc/regexp/regexp1.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: