For example, see this old commit setting the WebKit maximum nesting depth to 2048. I am told it is 512 by default today. <a href="https:&#x2F;&#x2F;www.mail-archive.com&#x2F;webkit-changes@lists.webkit.org&#x2F;msg02599.html" rel="nofollow">https:&#x2F;&#x2F;www.mail-archive.com&#x2F;webkit-changes@lists.webkit.org...</a> I&#x27;m fairly certain all browsers will impose such a limit or risk blowing their stack and crashing. Turns out there are advantages to setting upper bounds after all. Who&#x27;da thunk?<p>Regarding the BDD approach, it looks like somebody already implements it with excellent performance and memory characteristics: <a href="http:&#x2F;&#x2F;www.cs.rutgers.edu&#x2F;~vinodg&#x2F;papers&#x2F;raid2010&#x2F;raid2010_slides.pps" rel="nofollow">http:&#x2F;&#x2F;www.cs.rutgers.edu&#x2F;~vinodg&#x2F;papers&#x2F;raid2010&#x2F;raid2010_s...</a><p>Of course, the point (if you read back) was not to say that you <i>should</i> use REs for all parsing. Just merely to correct a commonly repeated mistake that &#x27;REs cannot parse HTML&#x27;. They can do so just fine.