<div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, 4 Mar 2024, 08:27 Rob Pike, <<a href="mailto:robpike@gmail.com">robpike@gmail.com</a>> wrote [to Larry]</div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">Oh happy days. Hi Rob, loved the book. </div><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif">If that's really true, that you learned from Spencer's library, then you didn't learn the most important thing about them, which is the automata theory that guarantees their performance is always linear. Not to take anything away from Henry, who admitted at the time that it could be slow for bad expressions, but we're still paying the price for refusing to connect "regex" with the theory that created them, ignoring it in fact.</div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">I once got into a bunfight with a Googler on the topic of coding interview questions, on a related matter. He was promulgating a regular expression to correctly match/parse-out legitimate dotted-quad IPv4 addresses, including bounds-checking the octets to be in the range 0..255, and arguing that it since it was going to be run through a DFA that it was a sunk cost for efficiency and therefore perfect.</div><div dir="auto"><br></div><div dir="auto">The result looked like line noise, and he was perturbed that I said I would prefer to take a much simpler (NFA?) RE, parse out the ints and bounds-check them, just to reduce cognitive load and increase maintainability of code.</div><div dir="auto"><br></div><div dir="auto">We didn't really come to an agreement.</div><div dir="auto"><br></div><div dir="auto">-a</div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>