4 ms·
RE2 – a regex engine not susceptible to denial of service attacks
- romanhn 12y agoIf you are developing server-side code where a user supplies both a regex and the content, be aware that it is trivial to DDOS most regex engines - see http://en.wikipedia.org/wiki/ReDoS http://en.wikipedia.org/wiki/ReDoS. The RE2 library leaves out certain features of the regular expression "language" (such as backreferences) in order to achieve linear time execution and limited memory footprint. Much better than most build-in language regex engines. Not affiliated with them, but figured it might be useful for some.
- SixSigma 12y agoFor more background on this library, read Russ' excellent articles on Regular Expressions http://swtch.com/~rsc/regexp/ http://swtch.com/~rsc/regexp/