Why nginx's http parser doesnt use regular expressions?

anshuk kumar anshukk at gmail.com
Sun Jun 23 05:46:21 UTC 2013


This is in reference to the following code

https://github.com/joyent/http-parser

What could be the main reason for such a design decision? I guess I could
write few regular expressions to parse HTTP req & res this would be a lot
less complex than Igor's version of the parser.

What am I missing here?


On some discussion with over nginx's IRC i got the following points

* HTTP parsing requires recursive exp resolution which is not possible
using regexp

* State Machines are faster?

* A tool like ragel is used to create such state machine?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130623/a642d764/attachment.html>


More information about the nginx-devel mailing list